本文整理汇总了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);
}
示例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;
}
示例3: storageProfile
import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
@Override
public StorageProfile storageProfile() {
return this.inner().storageProfile();
}
示例4: storageProfile
import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
@Override
public StorageProfile storageProfile() {
return inner().storageProfile();
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例9: storageProfile
import com.microsoft.azure.management.compute.StorageProfile; //导入依赖的package包/类
/**
* Get the storageProfile value.
*
* @return the storageProfile value
*/
public StorageProfile storageProfile() {
return this.storageProfile;
}
示例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;
}
示例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;
}