Class VirtualMachineRunCommandUpdate
java.lang.Object
com.azure.resourcemanager.compute.models.UpdateResource
com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate
- All Implemented Interfaces:
com.azure.json.JsonSerializable<UpdateResource>
Describes a Virtual Machine run command.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of VirtualMachineRunCommandUpdate class. -
Method Summary
Modifier and TypeMethodDescriptionGet the asyncExecution property: Optional.Get the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob.Get the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of VirtualMachineRunCommandUpdate from the JsonReader.Get the instanceView property: The virtual machine run command instance view.Get the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob.Get the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded.Get the parameters property: The parameters used by the script.Get the protectedParameters property: The parameters used by the script.Get the provisioningState property: The provisioning state, which only appears in the response.Get the runAsPassword property: Specifies the user account password on the VM when executing the run command.Get the runAsUser property: Specifies the user account on the VM when executing the run command.source()Get the source property: The source of the run command script.Get the timeoutInSeconds property: The timeout in seconds to execute the run command.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Get the treatFailureAsDeploymentFailure property: Optional.voidvalidate()Validates the instance.withAsyncExecution(Boolean asyncExecution) Set the asyncExecution property: Optional.withErrorBlobManagedIdentity(RunCommandManagedIdentity errorBlobManagedIdentity) Set the errorBlobManagedIdentity property: User-assigned managed identity that has access to errorBlobUri storage blob.withErrorBlobUri(String errorBlobUri) Set the errorBlobUri property: Specifies the Azure storage blob where script error stream will be uploaded.withOutputBlobManagedIdentity(RunCommandManagedIdentity outputBlobManagedIdentity) Set the outputBlobManagedIdentity property: User-assigned managed identity that has access to outputBlobUri storage blob.withOutputBlobUri(String outputBlobUri) Set the outputBlobUri property: Specifies the Azure storage blob where script output stream will be uploaded.withParameters(List<RunCommandInputParameter> parameters) Set the parameters property: The parameters used by the script.withProtectedParameters(List<RunCommandInputParameter> protectedParameters) Set the protectedParameters property: The parameters used by the script.withRunAsPassword(String runAsPassword) Set the runAsPassword property: Specifies the user account password on the VM when executing the run command.withRunAsUser(String runAsUser) Set the runAsUser property: Specifies the user account on the VM when executing the run command.Set the source property: The source of the run command script.Set the tags property: Resource tags.withTimeoutInSeconds(Integer timeoutInSeconds) Set the timeoutInSeconds property: The timeout in seconds to execute the run command.withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) Set the treatFailureAsDeploymentFailure property: Optional.Methods inherited from class UpdateResource
tagsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
VirtualMachineRunCommandUpdate
public VirtualMachineRunCommandUpdate()Creates an instance of VirtualMachineRunCommandUpdate class.
-
-
Method Details
-
withTags
Set the tags property: Resource tags.- Overrides:
withTagsin classUpdateResource- Parameters:
tags- the tags value to set.- Returns:
- the UpdateResource object itself.
-
source
Get the source property: The source of the run command script.- Returns:
- the source value.
-
withSource
Set the source property: The source of the run command script.- Parameters:
source- the source value to set.- Returns:
- the VirtualMachineRunCommandUpdate object itself.
-
parameters
Get the parameters property: The parameters used by the script.- Returns:
- the parameters value.
-
withParameters
Set the parameters property: The parameters used by the script.- Parameters:
parameters- the parameters value to set.- Returns:
- the VirtualMachineRunCommandUpdate object itself.
-
protectedParameters
Get the protectedParameters property: The parameters used by the script.- Returns:
- the protectedParameters value.
-
withProtectedParameters
public VirtualMachineRunCommandUpdate withProtectedParameters(List<RunCommandInputParameter> protectedParameters) Set the protectedParameters property: The parameters used by the script.- Parameters:
protectedParameters- the protectedParameters value to set.- Returns:
- the VirtualMachineRunCommandUpdate object itself.
-
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.
-
withAsyncExecution
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 VirtualMachineRunCommandUpdate object itself.
-
runAsUser
Get the runAsUser property: Specifies the user account on the VM when executing the run command.- Returns:
- the runAsUser value.
-
withRunAsUser
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 VirtualMachineRunCommandUpdate object itself.
-
runAsPassword
Get the runAsPassword property: Specifies the user account password on the VM when executing the run command.- Returns:
- the runAsPassword value.
-
withRunAsPassword
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 VirtualMachineRunCommandUpdate object itself.
-
timeoutInSeconds
Get the timeoutInSeconds property: The timeout in seconds to execute the run command.- Returns:
- the timeoutInSeconds value.
-
withTimeoutInSeconds
Set the timeoutInSeconds property: The timeout in seconds to execute the run command.- Parameters:
timeoutInSeconds- the timeoutInSeconds value to set.- Returns:
- the VirtualMachineRunCommandUpdate object itself.
-
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.
-
withOutputBlobUri
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 VirtualMachineRunCommandUpdate object itself.
-
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.
-
withErrorBlobUri
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 VirtualMachineRunCommandUpdate object itself.
-
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.
-
withOutputBlobManagedIdentity
public VirtualMachineRunCommandUpdate 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 VirtualMachineRunCommandUpdate object itself.
-
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.
-
withErrorBlobManagedIdentity
public VirtualMachineRunCommandUpdate 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 VirtualMachineRunCommandUpdate object itself.
-
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.
-
instanceView
Get the instanceView property: The virtual machine run command instance view.- Returns:
- the instanceView value.
-
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.
-
withTreatFailureAsDeploymentFailure
public VirtualMachineRunCommandUpdate 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 VirtualMachineRunCommandUpdate object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classUpdateResource- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<UpdateResource>- Overrides:
toJsonin classUpdateResource- Throws:
IOException
-
fromJson
public static VirtualMachineRunCommandUpdate fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of VirtualMachineRunCommandUpdate from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of VirtualMachineRunCommandUpdate 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 VirtualMachineRunCommandUpdate.
-