/** * @return the LUN value of the data disk image if this disk or snapshot is created from * a data disk image, -1 otherwise */ public int sourceDataDiskImageLun() { if (this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { return this.creationData.imageReference().lun(); } return -1; } }
/** * @return the LUN value of the data disk image if this disk or snapshot is created from * a data disk image, -1 otherwise */ public int sourceDataDiskImageLun() { if (this.type() == CreationSourceType.FROM_DATA_DISK_IMAGE) { return this.creationData.imageReference().lun(); } return -1; } }
DiskCreateOption createOption = this.creationData.createOption(); if (createOption == DiskCreateOption.FROM_IMAGE) { ImageDiskReference imageReference = this.creationData.imageReference(); if (imageReference.lun() == null) { return CreationSourceType.FROM_OS_DISK_IMAGE;
DiskCreateOption createOption = this.creationData.createOption(); if (createOption == DiskCreateOption.FROM_IMAGE) { ImageDiskReference imageReference = this.creationData.imageReference(); if (imageReference.lun() == null) { return CreationSourceType.FROM_OS_DISK_IMAGE;
/** * @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; }