當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。