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


Java StorageProfile类代码示例

本文整理汇总了Java中com.microsoft.azure.management.compute.StorageProfile的典型用法代码示例。如果您正苦于以下问题:Java StorageProfile类的具体用法?Java StorageProfile怎么用?Java StorageProfile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StorageProfile类属于com.microsoft.azure.management.compute包,在下文中一共展示了StorageProfile类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: wrapModel

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的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: isOSDiskFromPlatformImage

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Checks whether the OS disk is based on an platform image (image in PIR).
 *
 * @param storageProfile the storage profile
 * @return true if the OS disk is configured to be based on platform image.
 */
private boolean isOSDiskFromPlatformImage(StorageProfile storageProfile) {
    ImageReferenceInner imageReference  = storageProfile.imageReference();
    return isOSDiskFromImage(storageProfile.osDisk())
            && imageReference != null
            && imageReference.publisher() != null
            && imageReference.offer() != null
            && imageReference.sku() != null
            && imageReference.version() != null;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:16,代码来源:VirtualMachineImpl.java

示例3: storageProfile

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
@Override
public StorageProfile storageProfile() {
    return this.inner().storageProfile();
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:5,代码来源:VirtualMachineScaleSetVMImpl.java

示例4: storageProfile

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
@Override
public StorageProfile storageProfile() {
    return inner().storageProfile();
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:5,代码来源:VirtualMachineImpl.java

示例5: setOSDiskDefaults

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
private void setOSDiskDefaults() {
    if (isInUpdateMode()) {
        return;
    }
    StorageProfile storageProfile = this.inner().storageProfile();
    OSDisk osDisk = storageProfile.osDisk();
    if (isOSDiskFromImage(osDisk)) {
        // ODDisk CreateOption: FROM_IMAGE
        //
        if (isManagedDiskEnabled()) {
            // Note:
            // Managed disk
            //     Supported: PlatformImage and CustomImage
            //     UnSupported: StoredImage
            //
            if (osDisk.managedDisk() == null) {
                osDisk.withManagedDisk(new ManagedDiskParametersInner());
            }
            if (osDisk.managedDisk().storageAccountType() == null) {
                osDisk.managedDisk()
                        .withStorageAccountType(StorageAccountTypes.STANDARD_LRS);
            }
            osDisk.withVhd(null);
            // We won't set osDisk.name() explicitly for managed disk, if it is null CRP generates unique
            // name for the disk resource within the resource group.
        } else {
            // Note:
            // Native (un-managed) disk
            //     Supported: PlatformImage and StoredImage
            //     UnSupported: CustomImage
            //
            if (isOSDiskFromPlatformImage(storageProfile)
                    || isOSDiskFromStoredImage(storageProfile)) {
                if (osDisk.vhd() == null) {
                    String osDiskVhdContainerName = "vhds";
                    String osDiskVhdName = this.vmName + "-os-disk-" + UUID.randomUUID().toString() + ".vhd";
                    withOSDiskVhdLocation(osDiskVhdContainerName, osDiskVhdName);
                }
                osDisk.withManagedDisk(null);
            }
            if (osDisk.name() == null) {
                withOSDiskName(this.vmName + "-os-disk");
            }
        }
    } else {
        // ODDisk CreateOption: ATTACH
        //
        if (isManagedDiskEnabled()) {
            // In case of attach, it is not allowed to change the storage account type of the
            // managed disk.
            //
            if (osDisk.managedDisk() != null) {
                osDisk.managedDisk().withStorageAccountType(null);
            }
            osDisk.withVhd(null);
        } else {
            osDisk.withManagedDisk(null);
            if (osDisk.name() == null) {
                withOSDiskName(this.vmName + "-os-disk");
            }
        }
    }
    if (osDisk.caching() == null) {
        withOSDiskCaching(CachingTypes.READ_WRITE);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:67,代码来源:VirtualMachineImpl.java

示例6: setOSProfileDefaults

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
private void setOSProfileDefaults() {
    if (isInUpdateMode()) {
        return;
    }
    StorageProfile storageProfile = this.inner().storageProfile();
    OSDisk osDisk = storageProfile.osDisk();
    if (isOSDiskFromImage(osDisk)) {
        // ODDisk CreateOption: FROM_IMAGE
        //
        if (osDisk.osType() == OperatingSystemTypes.LINUX || this.isMarketplaceLinuxImage) {
            // linux image: PlatformImage | CustomImage | StoredImage
            //
            OSProfile osProfile = this.inner().osProfile();
            if (osProfile.linuxConfiguration() == null) {
                osProfile.withLinuxConfiguration(new LinuxConfiguration());
            }
            this.inner().osProfile()
                    .linuxConfiguration()
                    .withDisablePasswordAuthentication(osProfile.adminPassword() == null);
        }
        if (this.inner().osProfile().computerName() == null) {
            // VM name cannot contain only numeric values and cannot exceed 15 chars
            //
            if (vmName.matches("[0-9]+")) {
                this.inner().osProfile()
                        .withComputerName(SdkContext.randomResourceName("vm", 15));
            } else if (vmName.length() <= 15) {
                this.inner().osProfile()
                        .withComputerName(vmName);
            } else {
                this.inner().osProfile()
                        .withComputerName(SdkContext.randomResourceName("vm", 15));
            }
        }
    } else {
        // ODDisk CreateOption: ATTACH
        //
        // OS Profile must be set to null when an VM's OS disk is ATTACH-ed to a managed disk or
        // Specialized VHD
        //
        this.inner().withOsProfile(null);
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:44,代码来源:VirtualMachineImpl.java

示例7: isOsDiskFromCustomImage

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Checks whether the OS disk is based on a CustomImage.
 * <p>
 * A custom image is represented by {@link com.microsoft.azure.management.compute.VirtualMachineCustomImage}.
 *
 * @param storageProfile the storage profile
 * @return true if the OS disk is configured to be based on custom image.
 */
private boolean isOsDiskFromCustomImage(StorageProfile storageProfile) {
    ImageReferenceInner imageReference  = storageProfile.imageReference();
    return isOSDiskFromImage(storageProfile.osDisk())
            && imageReference != null
            && imageReference.id() != null;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:VirtualMachineImpl.java

示例8: isOSDiskFromStoredImage

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature').
 * <p>
 * A stored image is created by calling {@link VirtualMachine#capture(String, String, boolean)}.
 *
 * @param storageProfile the storage profile
 * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature')
 */
private boolean isOSDiskFromStoredImage(StorageProfile storageProfile) {
    OSDisk osDisk = storageProfile.osDisk();
    return isOSDiskFromImage(osDisk)
            && osDisk.image() != null
            && osDisk.image().uri() != null;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:VirtualMachineImpl.java

示例9: storageProfile

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Get the storageProfile value.
 *
 * @return the storageProfile value
 */
public StorageProfile storageProfile() {
    return this.storageProfile;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:9,代码来源:VirtualMachineInner.java

示例10: withStorageProfile

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Set the storageProfile value.
 *
 * @param storageProfile the storageProfile value to set
 * @return the VirtualMachineInner object itself.
 */
public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) {
    this.storageProfile = storageProfile;
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:11,代码来源:VirtualMachineInner.java

示例11: withStorageProfile

import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
 * Set the storageProfile value.
 *
 * @param storageProfile the storageProfile value to set
 * @return the VirtualMachineScaleSetVMInner object itself.
 */
public VirtualMachineScaleSetVMInner withStorageProfile(StorageProfile storageProfile) {
    this.storageProfile = storageProfile;
    return this;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:11,代码来源:VirtualMachineScaleSetVMInner.java


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