当前位置: 首页>>代码示例>>Java>>正文


Java DataDisk类代码示例

本文整理汇总了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);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:18,代码来源:VirtualMachinesImpl.java

示例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));
        }
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:17,代码来源:VirtualMachineImpl.java

示例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);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:21,代码来源:VirtualMachineImpl.java

示例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);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:17,代码来源:VirtualMachineImpl.java

示例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);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:21,代码来源:VirtualMachineImpl.java

示例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);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:14,代码来源:VirtualMachineScaleSetVMImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:8,代码来源:VirtualMachineImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:11,代码来源:VirtualMachineImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:9,代码来源:VirtualMachineImpl.java

示例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);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:11,代码来源:VirtualMachineImpl.java

示例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++;
        }
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:14,代码来源:VirtualMachineImpl.java

示例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);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:9,代码来源:UnmanagedDataDiskImpl.java

示例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;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:28,代码来源:AzureComputeEnumerationAdapterService.java

示例14: VirtualMachineDataDiskImpl

import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
VirtualMachineDataDiskImpl(DataDisk dataDiskInner) {
    super(dataDiskInner);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:4,代码来源:VirtualMachineDataDiskImpl.java

示例15: UnmanagedDataDiskImpl

import com.microsoft.azure.management.compute.DataDisk; //导入依赖的package包/类
protected UnmanagedDataDiskImpl(DataDisk inner, VirtualMachineImpl parent) {
    super(inner, parent);
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:4,代码来源:UnmanagedDataDiskImpl.java


注:本文中的com.microsoft.azure.management.compute.DataDisk类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。