ImageReference Class
- java.
lang. Object - com.
azure. core. management. SubResource - com.
azure. resourcemanager. compute. models. ImageReference
- com.
- com.
public final class ImageReference
extends SubResource
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 Image |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
communityGalleryImageId()
Get the community |
String |
exactVersion()
Get the exact |
static
Image |
fromJson(JsonReader jsonReader)
Reads an instance of Image |
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 |
sharedGalleryImageId()
Get the shared |
String |
sku()
Get the sku property: The image SKU. |
Json |
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. |
Image |
withCommunityGalleryImageId(String communityGalleryImageId)
Set the community |
Image |
withId(String id) |
Image |
withOffer(String offer)
Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual machine. |
Image |
withPublisher(String publisher)
Set the publisher property: The image publisher. |
Image |
withSharedGalleryImageId(String sharedGalleryImageId)
Set the shared |
Image |
withSku(String sku)
Set the sku property: The image SKU. |
Image |
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 SubResource
Methods inherited from java.lang.Object
Constructor Details
ImageReference
public ImageReference()
Creates an instance of ImageReference class.
Method Details
communityGalleryImageId
public String communityGalleryImageId()
Get the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call.
Returns:
exactVersion
public String exactVersion()
Get the exactVersion property: Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'.
Returns:
fromJson
public static ImageReference fromJson(JsonReader jsonReader)
Reads an instance of ImageReference from the JsonReader.
Parameters:
Returns:
Throws:
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:
publisher
public String publisher()
Get the publisher property: The image publisher.
Returns:
sharedGalleryImageId
public String sharedGalleryImageId()
Get the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.
Returns:
sku
public String sku()
Get the sku property: The image SKU.
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
ImageReference.toJson(JsonWriter jsonWriter)Parameters:
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. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input.
Returns:
withCommunityGalleryImageId
public ImageReference withCommunityGalleryImageId(String communityGalleryImageId)
Set the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call.
Parameters:
Returns:
withId
public ImageReference withId(String id)
Overrides:
ImageReference.withId(String id)Parameters:
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:
Returns:
withPublisher
public ImageReference withPublisher(String publisher)
Set the publisher property: The image publisher.
Parameters:
Returns:
withSharedGalleryImageId
public ImageReference withSharedGalleryImageId(String sharedGalleryImageId)
Set the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.
Parameters:
Returns:
withSku
public ImageReference withSku(String sku)
Set the sku property: The image SKU.
Parameters:
Returns:
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. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input.
Parameters:
Returns:
Applies to
Azure SDK for Java