Partilhar via


HardwareProfile Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.models.HardwareProfile

Implements

public final class HardwareProfile
implements JsonSerializable<HardwareProfile>

Specifies the hardware settings for the virtual machine.

Constructor Summary

Constructor Description
HardwareProfile()

Creates an instance of HardwareProfile class.

Method Summary

Modifier and Type Method and Description
static HardwareProfile fromJson(JsonReader jsonReader)

Reads an instance of HardwareProfile from the JsonReader.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

VirtualMachineSizeTypes vmSize()

Get the vmSize property: Specifies the size of the virtual machine.

VMSizeProperties vmSizeProperties()

Get the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine.

HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize)

Set the vmSize property: Specifies the size of the virtual machine.

HardwareProfile withVmSizeProperties(VMSizeProperties vmSizeProperties)

Set the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine.

Methods inherited from java.lang.Object

Constructor Details

HardwareProfile

public HardwareProfile()

Creates an instance of HardwareProfile class.

Method Details

fromJson

public static HardwareProfile fromJson(JsonReader jsonReader)

Reads an instance of HardwareProfile from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of HardwareProfile if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the HardwareProfile.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

vmSize

public VirtualMachineSizeTypes vmSize()

Get the vmSize property: Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set.

Returns:

the vmSize value.

vmSizeProperties

public VMSizeProperties vmSizeProperties()

Get the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details.

Returns:

the vmSizeProperties value.

withVmSize

public HardwareProfile withVmSize(VirtualMachineSizeTypes vmSize)

Set the vmSize property: Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set.

Parameters:

vmSize - the vmSize value to set.

Returns:

the HardwareProfile object itself.

withVmSizeProperties

public HardwareProfile withVmSizeProperties(VMSizeProperties vmSizeProperties)

Set the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details.

Parameters:

vmSizeProperties - the vmSizeProperties value to set.

Returns:

the HardwareProfile object itself.

Applies to