/** * @return ID of the source */ public String sourceId() { if (this.type() == CreationSourceType.FROM_OS_DISK_IMAGE || this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { return this.creationData.imageReference().id(); } if (this.type() == CreationSourceType.IMPORTED_FROM_VHD) { return this.creationData.sourceUri(); } if (this.type() == CreationSourceType.COPIED_FROM_DISK) { String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId == null) { sourceResourceId = this.creationData.sourceUri(); } return sourceResourceId; } if (this.type() == CreationSourceType.COPIED_FROM_SNAPSHOT) { String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId == null) { sourceResourceId = this.creationData.sourceUri(); } return sourceResourceId; } return null; }
/** * @return ID of the source */ public String sourceId() { if (this.type() == CreationSourceType.FROM_OS_DISK_IMAGE || this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { return this.creationData.imageReference().id(); } if (this.type() == CreationSourceType.IMPORTED_FROM_VHD) { return this.creationData.sourceUri(); } if (this.type() == CreationSourceType.COPIED_FROM_DISK) { String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId == null) { sourceResourceId = this.creationData.sourceUri(); } return sourceResourceId; } if (this.type() == CreationSourceType.COPIED_FROM_SNAPSHOT) { String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId == null) { sourceResourceId = this.creationData.sourceUri(); } return sourceResourceId; } return null; }