本文整理汇总了Java中com.microsoft.azure.management.compute.DataDisk.withManagedDisk方法的典型用法代码示例。如果您正苦于以下问题:Java DataDisk.withManagedDisk方法的具体用法?Java DataDisk.withManagedDisk怎么用?Java DataDisk.withManagedDisk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.microsoft.azure.management.compute.DataDisk
的用法示例。
在下文中一共展示了DataDisk.withManagedDisk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}