ImageReference Class

  • java.lang.Object
    • com.azure.resourcemanager.workloads.models.ImageReference

Implements

public final class ImageReference
implements JsonSerializable<ImageReference>

Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.

Constructor Summary

Constructor Description
ImageReference()

Creates an instance of ImageReference class.

Method Summary

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

Reads an instance of ImageReference from the JsonReader.

String offer()

Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual machine.

String publisher()

Get the publisher property: The image publisher.

String sku()

Get the sku property: The image SKU.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

String version()

Get the version property: Specifies the version of the platform image or marketplace image used to create the virtual machine.

ImageReference withOffer(String offer)

Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual machine.

ImageReference withPublisher(String publisher)

Set the publisher property: The image publisher.

ImageReference withSku(String sku)

Set the sku property: The image SKU.

ImageReference withVersion(String version)

Set the version property: Specifies the version of the platform image or marketplace image used to create the virtual machine.

Methods inherited from java.lang.Object

Constructor Details

ImageReference

public ImageReference()

Creates an instance of ImageReference class.

Method Details

fromJson

public static ImageReference fromJson(JsonReader jsonReader)

Reads an instance of ImageReference from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ImageReference 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 ImageReference.

offer

public String offer()

Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual machine.

Returns:

the offer value.

publisher

public String publisher()

Get the publisher property: The image publisher.

Returns:

the publisher value.

sku

public String sku()

Get the sku property: The image SKU.

Returns:

the sku value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

version

public String version()

Get the version property: Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.

Returns:

the version value.

withOffer

public ImageReference withOffer(String offer)

Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual machine.

Parameters:

offer - the offer value to set.

Returns:

the ImageReference object itself.

withPublisher

public ImageReference withPublisher(String publisher)

Set the publisher property: The image publisher.

Parameters:

publisher - the publisher value to set.

Returns:

the ImageReference object itself.

withSku

public ImageReference withSku(String sku)

Set the sku property: The image SKU.

Parameters:

sku - the sku value to set.

Returns:

the ImageReference object itself.

withVersion

public ImageReference withVersion(String version)

Set the version property: Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.

Parameters:

version - the version value to set.

Returns:

the ImageReference object itself.

Applies to