本文整理汇总了Java中com.microsoft.azure.management.compute.DataDisk类的典型用法代码示例。如果您正苦于以下问题:Java DataDisk类的具体用法?Java DataDisk怎么用?Java DataDisk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataDisk类属于com.microsoft.azure.management.compute包,在下文中一共展示了DataDisk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wrapModel
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
@Override
protected VirtualMachineImpl wrapModel(String name) {
VirtualMachineInner inner = new VirtualMachineInner();
inner.withStorageProfile(new StorageProfile()
.withOsDisk(new OSDisk())
.withDataDisks(new ArrayList<DataDisk>()));
inner.withOsProfile(new OSProfile());
inner.withHardwareProfile(new HardwareProfile());
inner.withNetworkProfile(new NetworkProfile()
.withNetworkInterfaces(new ArrayList<NetworkInterfaceReferenceInner>()));
return new VirtualMachineImpl(name,
inner,
this.manager(),
this.storageManager,
this.networkManager,
this.rbacManager);
}
示例2: initializeDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void initializeDataDisks() {
if (this.inner().storageProfile().dataDisks() == null) {
this.inner()
.storageProfile()
.withDataDisks(new ArrayList<DataDisk>());
}
this.isUnmanagedDiskSelected = false;
this.managedDataDisks.clear();
this.unmanagedDataDisks = new ArrayList<>();
if (!isManagedDiskEnabled()) {
for (DataDisk dataDiskInner : this.storageProfile().dataDisks()) {
this.unmanagedDataDisks.add(new UnmanagedDataDiskImpl(dataDiskInner, this));
}
}
}
示例3: setAttachableNewDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void setAttachableNewDataDisks(Func0<Integer> nextLun) {
List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks();
for (Map.Entry<String, DataDisk> entry : this.newDisksToAttach.entrySet()) {
Disk managedDisk = vm.<Disk>taskResult(entry.getKey());
DataDisk dataDisk = entry.getValue();
dataDisk.withCreateOption(DiskCreateOptionTypes.ATTACH);
if (dataDisk.lun() == -1) {
dataDisk.withLun(nextLun.call());
}
dataDisk.withManagedDisk(new ManagedDiskParametersInner());
dataDisk.managedDisk().withId(managedDisk.id());
if (dataDisk.caching() == null) {
dataDisk.withCaching(getDefaultCachingType());
}
// Don't set default storage account type for the attachable managed disks, it is already
// defined in the managed disk and not allowed to change.
dataDisk.withName(null);
dataDisks.add(dataDisk);
}
}
示例4: setAttachableExistingDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void setAttachableExistingDataDisks(Func0<Integer> nextLun) {
List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks();
for (DataDisk dataDisk : this.existingDisksToAttach) {
dataDisk.withCreateOption(DiskCreateOptionTypes.ATTACH);
if (dataDisk.lun() == -1) {
dataDisk.withLun(nextLun.call());
}
if (dataDisk.caching() == null) {
dataDisk.withCaching(getDefaultCachingType());
}
// Don't set default storage account type for the attachable managed disks, it is already
// defined in the managed disk and not allowed to change.
dataDisk.withName(null);
dataDisks.add(dataDisk);
}
}
示例5: setImplicitDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void setImplicitDataDisks(Func0<Integer> nextLun) {
List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks();
for (DataDisk dataDisk : this.implicitDisksToAssociate) {
dataDisk.withCreateOption(DiskCreateOptionTypes.EMPTY);
if (dataDisk.lun() == -1) {
dataDisk.withLun(nextLun.call());
}
if (dataDisk.caching() == null) {
dataDisk.withCaching(getDefaultCachingType());
}
if (dataDisk.managedDisk() == null) {
dataDisk.withManagedDisk(new ManagedDiskParametersInner());
}
if (dataDisk.managedDisk().storageAccountType() == null) {
dataDisk.managedDisk().withStorageAccountType(getDefaultStorageAccountType());
}
dataDisk.withName(null);
dataDisks.add(dataDisk);
}
}
示例6: unmanagedDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
@Override
public Map<Integer, VirtualMachineUnmanagedDataDisk> unmanagedDataDisks() {
Map<Integer, VirtualMachineUnmanagedDataDisk> dataDisks = new HashMap<>();
if (!isManagedDiskEnabled()) {
List<DataDisk> innerDataDisks = this.inner().storageProfile().dataDisks();
if (innerDataDisks != null) {
for (DataDisk innerDataDisk : innerDataDisks) {
dataDisks.put(innerDataDisk.lun(), new UnmanagedDataDiskImpl(innerDataDisk, null));
}
}
}
return Collections.unmodifiableMap(dataDisks);
}
示例7: withNewDataDisk
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
@Override
public VirtualMachineImpl withNewDataDisk(Creatable<Disk> creatable) {
throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED);
this.managedDataDisks.newDisksToAttach.put(this.addDependency(creatable),
new DataDisk().withLun(-1));
return this;
}
示例8: withExistingDataDisk
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
@Override
public VirtualMachineImpl withExistingDataDisk(Disk disk) {
throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED);
ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner();
managedDiskParameters.withId(disk.id());
this.managedDataDisks.existingDisksToAttach.add(new DataDisk()
.withLun(-1)
.withManagedDisk(managedDiskParameters));
return this;
}
示例9: withNewDataDiskFromImage
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
@Override
public VirtualMachineImpl withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType) {
this.managedDataDisks.newDisksFromImage.add(new DataDisk()
.withLun(imageLun)
.withDiskSizeGB(newSizeInGB)
.withCaching(cachingType));
return this;
}
示例10: setImageBasedDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void setImageBasedDataDisks() {
List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks();
for (DataDisk dataDisk : this.newDisksFromImage) {
dataDisk.withCreateOption(DiskCreateOptionTypes.FROM_IMAGE);
// Don't set default storage account type for the disk, either user has to specify it explicitly or let
// CRP pick it from the image
dataDisk.withName(null);
dataDisks.add(dataDisk);
}
}
示例11: removeDataDisks
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private void removeDataDisks() {
List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks();
for (Integer lun : this.diskLunsToRemove) {
int indexToRemove = 0;
for (DataDisk dataDisk : dataDisks) {
if (dataDisk.lun() == lun) {
dataDisks.remove(indexToRemove);
break;
}
indexToRemove++;
}
}
}
示例12: prepareDataDisk
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
protected static UnmanagedDataDiskImpl prepareDataDisk(String name,
VirtualMachineImpl parent) {
DataDisk dataDiskInner = new DataDisk();
dataDiskInner.withLun(-1)
.withName(name)
.withVhd(null);
return new UnmanagedDataDiskImpl(dataDiskInner, parent);
}
示例13: createDataDiskState
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
private DiskState createDataDiskState(EnumerationContext ctx, DataDisk dataDisk, boolean isManaged) {
DiskState diskState = new DiskState();
String id = UUID.randomUUID().toString();
diskState.documentSelfLink = UriUtils.buildUriPath(DiskService.FACTORY_LINK, id);
diskState.name = dataDisk.name();
if (isManaged) {
diskState.id = dataDisk.managedDisk().id();
} else {
diskState.id = AzureUtils.canonizeId(dataDisk.vhd().uri());
}
diskState.capacityMBytes = dataDisk.diskSizeGB() * 1024;
diskState.status = DiskService.DiskStatus.ATTACHED;
diskState.tenantLinks = ctx.parentCompute.tenantLinks;
diskState.resourcePoolLink = ctx.request.resourcePoolLink;
diskState.computeHostLink = ctx.parentCompute.documentSelfLink;
diskState.endpointLink = ctx.request.endpointLink;
AdapterUtils.addToEndpointLinks(diskState, ctx.request.endpointLink);
diskState.customProperties = new HashMap<>();
diskState.customProperties.put(AZURE_DATA_DISK_CACHING, dataDisk.caching().name());
diskState.customProperties.put(DISK_CONTROLLER_NUMBER, String.valueOf(dataDisk.lun()));
diskState.customProperties.put(AZURE_MANAGED_DISK_TYPE,
dataDisk.managedDisk().storageAccountType().toString());
return diskState;
}
示例14: VirtualMachineDataDiskImpl
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
VirtualMachineDataDiskImpl(DataDisk dataDiskInner) {
super(dataDiskInner);
}
示例15: UnmanagedDataDiskImpl
import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
protected UnmanagedDataDiskImpl(DataDisk inner, VirtualMachineImpl parent) {
super(inner, parent);
}