VirtualMachineRunCommandProperties Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandProperties

Implements

public final class VirtualMachineRunCommandProperties
implements JsonSerializable<VirtualMachineRunCommandProperties>

Describes the properties of a Virtual Machine run command.

Constructor Summary

Constructor Description
VirtualMachineRunCommandProperties()

Creates an instance of VirtualMachineRunCommandProperties class.

Method Summary

Modifier and Type Method and Description
Boolean asyncExecution()

Get the asyncExecution property: Optional.

RunCommandManagedIdentity errorBlobManagedIdentity()

Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob.

String errorBlobUri()

Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded.

static VirtualMachineRunCommandProperties fromJson(JsonReader jsonReader)

Reads an instance of VirtualMachineRunCommandProperties from the JsonReader.

VirtualMachineRunCommandInstanceView instanceView()

Get the instanceView property: The virtual machine run command instance view.

RunCommandManagedIdentity outputBlobManagedIdentity()

Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob.

String outputBlobUri()

Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded.

List<RunCommandInputParameter> parameters()

Get the parameters property: The parameters used by the script.

List<RunCommandInputParameter> protectedParameters()

Get the protectedParameters property: The parameters used by the script.

String provisioningState()

Get the provisioningState property: The provisioning state, which only appears in the response.

String runAsPassword()

Get the runAsPassword property: Specifies the user account password on the VM when executing the run command.

String runAsUser()

Get the runAsUser property: Specifies the user account on the VM when executing the run command.

VirtualMachineRunCommandScriptSource source()

Get the source property: The source of the run command script.

Integer timeoutInSeconds()

Get the timeoutInSeconds property: The timeout in seconds to execute the run command.

JsonWriter toJson(JsonWriter jsonWriter)
Boolean treatFailureAsDeploymentFailure()

Get the treatFailureAsDeploymentFailure property: Optional.

void validate()

Validates the instance.

VirtualMachineRunCommandProperties withAsyncExecution(Boolean asyncExecution)

Set the asyncExecution property: Optional.

VirtualMachineRunCommandProperties withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity)

Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob.

VirtualMachineRunCommandProperties withErrorBlobUri(String errorBlobUri)

Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded.

VirtualMachineRunCommandProperties withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity)

Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob.

VirtualMachineRunCommandProperties withOutputBlobUri(String outputBlobUri)

Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded.

VirtualMachineRunCommandProperties withParameters(List<RunCommandInputParameter> parameters)

Set the parameters property: The parameters used by the script.

VirtualMachineRunCommandProperties withProtectedParameters(List<RunCommandInputParameter> protectedParameters)

Set the protectedParameters property: The parameters used by the script.

VirtualMachineRunCommandProperties withRunAsPassword(String runAsPassword)

Set the runAsPassword property: Specifies the user account password on the VM when executing the run command.

VirtualMachineRunCommandProperties withRunAsUser(String runAsUser)

Set the runAsUser property: Specifies the user account on the VM when executing the run command.

VirtualMachineRunCommandProperties withSource(VirtualMachineRunCommandScriptSource source)

Set the source property: The source of the run command script.

VirtualMachineRunCommandProperties withTimeoutInSeconds(Integer timeoutInSeconds)

Set the timeoutInSeconds property: The timeout in seconds to execute the run command.

VirtualMachineRunCommandProperties withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure)

Set the treatFailureAsDeploymentFailure property: Optional.

Methods inherited from java.lang.Object

Constructor Details

VirtualMachineRunCommandProperties

public VirtualMachineRunCommandProperties()

Creates an instance of VirtualMachineRunCommandProperties class.

Method Details

asyncExecution

public Boolean asyncExecution()

Get the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete.

Returns:

the asyncExecution value.

errorBlobManagedIdentity

public RunCommandManagedIdentity errorBlobManagedIdentity()

Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.

Returns:

the errorBlobManagedIdentity value.

errorBlobUri

public String errorBlobUri()

Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.

Returns:

the errorBlobUri value.

fromJson

public static VirtualMachineRunCommandProperties fromJson(JsonReader jsonReader)

Reads an instance of VirtualMachineRunCommandProperties from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

instanceView

public VirtualMachineRunCommandInstanceView instanceView()

Get the instanceView property: The virtual machine run command instance view.

Returns:

the instanceView value.

outputBlobManagedIdentity

public RunCommandManagedIdentity outputBlobManagedIdentity()

Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.

Returns:

the outputBlobManagedIdentity value.

outputBlobUri

public String outputBlobUri()

Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter.

Returns:

the outputBlobUri value.

parameters

public List<RunCommandInputParameter> parameters()

Get the parameters property: The parameters used by the script.

Returns:

the parameters value.

protectedParameters

public List<RunCommandInputParameter> protectedParameters()

Get the protectedParameters property: The parameters used by the script.

Returns:

the protectedParameters value.

provisioningState

public String provisioningState()

Get the provisioningState property: The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged\#get-execution-status-and-results.

Returns:

the provisioningState value.

runAsPassword

public String runAsPassword()

Get the runAsPassword property: Specifies the user account password on the VM when executing the run command.

Returns:

the runAsPassword value.

runAsUser

public String runAsUser()

Get the runAsUser property: Specifies the user account on the VM when executing the run command.

Returns:

the runAsUser value.

source

public VirtualMachineRunCommandScriptSource source()

Get the source property: The source of the run command script.

Returns:

the source value.

timeoutInSeconds

public Integer timeoutInSeconds()

Get the timeoutInSeconds property: The timeout in seconds to execute the run command.

Returns:

the timeoutInSeconds value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

treatFailureAsDeploymentFailure

public Boolean treatFailureAsDeploymentFailure()

Get the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged\#get-execution-status-and-results.

Returns:

the treatFailureAsDeploymentFailure value.

validate

public void validate()

Validates the instance.

withAsyncExecution

public VirtualMachineRunCommandProperties withAsyncExecution(Boolean asyncExecution)

Set the asyncExecution property: Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete.

Parameters:

asyncExecution - the asyncExecution value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withErrorBlobManagedIdentity

public VirtualMachineRunCommandProperties withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity)

Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.

Parameters:

errorBlobManagedIdentity - the errorBlobManagedIdentity value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withErrorBlobUri

public VirtualMachineRunCommandProperties withErrorBlobUri(String errorBlobUri)

Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.

Parameters:

errorBlobUri - the errorBlobUri value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withOutputBlobManagedIdentity

public VirtualMachineRunCommandProperties withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity)

Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.

Parameters:

outputBlobManagedIdentity - the outputBlobManagedIdentity value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withOutputBlobUri

public VirtualMachineRunCommandProperties withOutputBlobUri(String outputBlobUri)

Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter.

Parameters:

outputBlobUri - the outputBlobUri value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withParameters

public VirtualMachineRunCommandProperties withParameters(List<RunCommandInputParameter> parameters)

Set the parameters property: The parameters used by the script.

Parameters:

parameters - the parameters value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withProtectedParameters

public VirtualMachineRunCommandProperties withProtectedParameters(List<RunCommandInputParameter> protectedParameters)

Set the protectedParameters property: The parameters used by the script.

Parameters:

protectedParameters - the protectedParameters value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withRunAsPassword

public VirtualMachineRunCommandProperties withRunAsPassword(String runAsPassword)

Set the runAsPassword property: Specifies the user account password on the VM when executing the run command.

Parameters:

runAsPassword - the runAsPassword value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withRunAsUser

public VirtualMachineRunCommandProperties withRunAsUser(String runAsUser)

Set the runAsUser property: Specifies the user account on the VM when executing the run command.

Parameters:

runAsUser - the runAsUser value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withSource

public VirtualMachineRunCommandProperties withSource(VirtualMachineRunCommandScriptSource source)

Set the source property: The source of the run command script.

Parameters:

source - the source value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withTimeoutInSeconds

public VirtualMachineRunCommandProperties withTimeoutInSeconds(Integer timeoutInSeconds)

Set the timeoutInSeconds property: The timeout in seconds to execute the run command.

Parameters:

timeoutInSeconds - the timeoutInSeconds value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

withTreatFailureAsDeploymentFailure

public VirtualMachineRunCommandProperties withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure)

Set the treatFailureAsDeploymentFailure property: Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged\#get-execution-status-and-results.

Parameters:

treatFailureAsDeploymentFailure - the treatFailureAsDeploymentFailure value to set.

Returns:

the VirtualMachineRunCommandProperties object itself.

Applies to