@Override public SnapshotImpl withDataFromDisk(String managedDiskId) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.COPY) .withSourceResourceId(managedDiskId); return this; }
@Override public DiskImpl fromVhd(String vhdUrl) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.IMPORT) .withSourceUri(vhdUrl); return this; }
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; String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId != null) { String resourceType = ResourceUtils.resourceTypeFromResourceId(sourceResourceId); if (this.creationData.sourceUri() != null) { sourceResourceId = this.creationData.sourceUri(); String resourceType = ResourceUtils.resourceTypeFromResourceId(sourceResourceId); if (resourceType.equalsIgnoreCase("disks")) {
/** * @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; }
@Override public DiskImpl withData() { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.EMPTY); return this; }
@Override public DiskCreateOption creationMethod() { return this.inner().creationData().createOption(); }
/** * @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; String sourceResourceId = this.creationData.sourceResourceId(); if (sourceResourceId != null) { String resourceType = ResourceUtils.resourceTypeFromResourceId(sourceResourceId); if (this.creationData.sourceUri() != null) { sourceResourceId = this.creationData.sourceUri(); String resourceType = ResourceUtils.resourceTypeFromResourceId(sourceResourceId); if (resourceType.equalsIgnoreCase("disks")) {
/** * @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; }
@Override public DiskImpl withData() { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.EMPTY); return this; }
@Override public DiskCreateOption creationMethod() { return this.inner().creationData().createOption(); }
/** * @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; } }
@Override public DiskImpl fromSnapshot(String snapshotId) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.COPY) .withSourceResourceId(snapshotId); return this; }
@Override public SnapshotImpl withDataFromVhd(String vhdUrl) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.IMPORT) .withSourceUri(vhdUrl); return this; }
@Override public DiskCreateOption creationMethod() { return this.inner().creationData().createOption(); }
@Override public DiskImpl fromDisk(String managedDiskId) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.COPY) .withSourceResourceId(managedDiskId); return this; }
@Override public DiskImpl fromVhd(String vhdUrl) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.IMPORT) .withSourceUri(vhdUrl); return this; }
@Override public DiskCreateOption creationMethod() { return this.inner().creationData().createOption(); }
@Override public SnapshotImpl withDataFromSnapshot(String snapshotId) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.COPY) .withSourceResourceId(snapshotId); return this; }
@Override public SnapshotImpl withDataFromVhd(String vhdUrl) { this.inner() .withCreationData(new CreationData()) .creationData() .withCreateOption(DiskCreateOption.IMPORT) .withSourceUri(vhdUrl); return this; }