diff --git a/sdk/compute/mgmt-v2020_06_01/pom.xml b/sdk/compute/mgmt-v2020_06_01/pom.xml index 6c70a47e1d3f..1049bb9b5573 100644 --- a/sdk/compute/mgmt-v2020_06_01/pom.xml +++ b/sdk/compute/mgmt-v2020_06_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-compute 1.0.0-beta diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/ExecutionState.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/ExecutionState.java new file mode 100644 index 000000000000..fb54b9c4d9d2 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/ExecutionState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExecutionState. + */ +public final class ExecutionState extends ExpandableStringEnum { + /** Static value Unknown for ExecutionState. */ + public static final ExecutionState UNKNOWN = fromString("Unknown"); + + /** Static value Pending for ExecutionState. */ + public static final ExecutionState PENDING = fromString("Pending"); + + /** Static value Running for ExecutionState. */ + public static final ExecutionState RUNNING = fromString("Running"); + + /** Static value Failed for ExecutionState. */ + public static final ExecutionState FAILED = fromString("Failed"); + + /** Static value Succeeded for ExecutionState. */ + public static final ExecutionState SUCCEEDED = fromString("Succeeded"); + + /** Static value TimedOut for ExecutionState. */ + public static final ExecutionState TIMED_OUT = fromString("TimedOut"); + + /** Static value Canceled for ExecutionState. */ + public static final ExecutionState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ExecutionState from its string representation. + * @param name a name to look for + * @return the corresponding ExecutionState + */ + @JsonCreator + public static ExecutionState fromString(String name) { + return fromString(name, ExecutionState.class); + } + + /** + * @return known ExecutionState values + */ + public static Collection values() { + return values(ExecutionState.class); + } +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/LocationVirtualMachineRunCommand.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/LocationVirtualMachineRunCommand.java new file mode 100644 index 000000000000..48ebc471439b --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/LocationVirtualMachineRunCommand.java @@ -0,0 +1,406 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineRunCommandInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.ComputeManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing LocationVirtualMachineRunCommand. + */ +public interface LocationVirtualMachineRunCommand extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the asyncExecution value. + */ + Boolean asyncExecution(); + + /** + * @return the errorBlobUri value. + */ + String errorBlobUri(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + VirtualMachineRunCommandInstanceView instanceView(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputBlobUri value. + */ + String outputBlobUri(); + + /** + * @return the parameters value. + */ + List parameters(); + + /** + * @return the protectedParameters value. + */ + List protectedParameters(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the runAsPassword value. + */ + String runAsPassword(); + + /** + * @return the runAsUser value. + */ + String runAsUser(); + + /** + * @return the source value. + */ + VirtualMachineRunCommandScriptSource source(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeoutInSeconds value. + */ + Integer timeoutInSeconds(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the LocationVirtualMachineRunCommand definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of LocationVirtualMachineRunCommand definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LocationVirtualMachineRunCommand definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies resourceGroupName, vmName. + * @param resourceGroupName The name of the resource group + * @param vmName The name of the virtual machine where the run command should be created or updated + * @return the next definition stage + */ + WithLocation withExistingLocation(String resourceGroupName, String vmName); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify AsyncExecution. + */ + interface WithAsyncExecution { + /** + * Specifies asyncExecution. + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete + * @return the next definition stage + */ + WithCreate withAsyncExecution(Boolean asyncExecution); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify ErrorBlobUri. + */ + interface WithErrorBlobUri { + /** + * Specifies errorBlobUri. + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded + * @return the next definition stage + */ + WithCreate withErrorBlobUri(String errorBlobUri); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify OutputBlobUri. + */ + interface WithOutputBlobUri { + /** + * Specifies outputBlobUri. + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded + * @return the next definition stage + */ + WithCreate withOutputBlobUri(String outputBlobUri); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify Parameters. + */ + interface WithParameters { + /** + * Specifies parameters. + * @param parameters The parameters used by the script + * @return the next definition stage + */ + WithCreate withParameters(List parameters); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify ProtectedParameters. + */ + interface WithProtectedParameters { + /** + * Specifies protectedParameters. + * @param protectedParameters The parameters used by the script + * @return the next definition stage + */ + WithCreate withProtectedParameters(List protectedParameters); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify RunAsPassword. + */ + interface WithRunAsPassword { + /** + * Specifies runAsPassword. + * @param runAsPassword Specifies the user account password on the VM when executing the run command + * @return the next definition stage + */ + WithCreate withRunAsPassword(String runAsPassword); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify RunAsUser. + */ + interface WithRunAsUser { + /** + * Specifies runAsUser. + * @param runAsUser Specifies the user account on the VM when executing the run command + * @return the next definition stage + */ + WithCreate withRunAsUser(String runAsUser); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The source of the run command script + * @return the next definition stage + */ + WithCreate withSource(VirtualMachineRunCommandScriptSource source); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the locationvirtualmachineruncommand definition allowing to specify TimeoutInSeconds. + */ + interface WithTimeoutInSeconds { + /** + * Specifies timeoutInSeconds. + * @param timeoutInSeconds The timeout in seconds to execute the run command + * @return the next definition stage + */ + WithCreate withTimeoutInSeconds(Integer timeoutInSeconds); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAsyncExecution, DefinitionStages.WithErrorBlobUri, DefinitionStages.WithOutputBlobUri, DefinitionStages.WithParameters, DefinitionStages.WithProtectedParameters, DefinitionStages.WithRunAsPassword, DefinitionStages.WithRunAsUser, DefinitionStages.WithSource, DefinitionStages.WithTags, DefinitionStages.WithTimeoutInSeconds { + } + } + /** + * The template for a LocationVirtualMachineRunCommand update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAsyncExecution, UpdateStages.WithErrorBlobUri, UpdateStages.WithOutputBlobUri, UpdateStages.WithParameters, UpdateStages.WithProtectedParameters, UpdateStages.WithRunAsPassword, UpdateStages.WithRunAsUser, UpdateStages.WithSource, UpdateStages.WithTags, UpdateStages.WithTimeoutInSeconds { + } + + /** + * Grouping of LocationVirtualMachineRunCommand update stages. + */ + interface UpdateStages { + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify AsyncExecution. + */ + interface WithAsyncExecution { + /** + * Specifies asyncExecution. + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete + * @return the next update stage + */ + Update withAsyncExecution(Boolean asyncExecution); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify ErrorBlobUri. + */ + interface WithErrorBlobUri { + /** + * Specifies errorBlobUri. + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded + * @return the next update stage + */ + Update withErrorBlobUri(String errorBlobUri); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify OutputBlobUri. + */ + interface WithOutputBlobUri { + /** + * Specifies outputBlobUri. + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded + * @return the next update stage + */ + Update withOutputBlobUri(String outputBlobUri); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify Parameters. + */ + interface WithParameters { + /** + * Specifies parameters. + * @param parameters The parameters used by the script + * @return the next update stage + */ + Update withParameters(List parameters); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify ProtectedParameters. + */ + interface WithProtectedParameters { + /** + * Specifies protectedParameters. + * @param protectedParameters The parameters used by the script + * @return the next update stage + */ + Update withProtectedParameters(List protectedParameters); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify RunAsPassword. + */ + interface WithRunAsPassword { + /** + * Specifies runAsPassword. + * @param runAsPassword Specifies the user account password on the VM when executing the run command + * @return the next update stage + */ + Update withRunAsPassword(String runAsPassword); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify RunAsUser. + */ + interface WithRunAsUser { + /** + * Specifies runAsUser. + * @param runAsUser Specifies the user account on the VM when executing the run command + * @return the next update stage + */ + Update withRunAsUser(String runAsUser); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The source of the run command script + * @return the next update stage + */ + Update withSource(VirtualMachineRunCommandScriptSource source); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the locationvirtualmachineruncommand update allowing to specify TimeoutInSeconds. + */ + interface WithTimeoutInSeconds { + /** + * Specifies timeoutInSeconds. + * @param timeoutInSeconds The timeout in seconds to execute the run command + * @return the next update stage + */ + Update withTimeoutInSeconds(Integer timeoutInSeconds); + } + + } +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachine.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachine.java index a1e723dd39d6..406addf935a2 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachine.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachine.java @@ -133,7 +133,7 @@ public interface VirtualMachine extends HasInner, Indexable /** * @return the resources value. */ - List resources(); + List resources(); /** * @return the securityProfile value. @@ -173,7 +173,7 @@ public interface VirtualMachine extends HasInner, Indexable /** * The entirety of the VirtualMachine definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithLocation, DefinitionStages.WithCreate { } /** @@ -183,19 +183,19 @@ interface DefinitionStages { /** * The first stage of a VirtualMachine definition. */ - interface Blank extends WithResourceGroup { + interface Blank extends WithLocation { } /** * The stage of the virtualmachine definition allowing to specify Location. */ - interface WithResourceGroup { + interface WithLocation { /** * Specifies resourceGroupName. * @param resourceGroupName The name of the resource group * @return the next definition stage */ - WithLocation withExistingResourceGroup(String resourceGroupName); + WithLocation withExistingLocation(String resourceGroupName); } /** @@ -336,7 +336,7 @@ interface WithIdentity { interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 + * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 * @return the next definition stage */ WithCreate withLicenseType(String licenseType); @@ -606,7 +606,7 @@ interface WithIdentity { interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 + * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 * @return the next update stage */ Update withLicenseType(String licenseType); diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtension.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtension.java new file mode 100644 index 000000000000..edb2f79e2814 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtension.java @@ -0,0 +1,389 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineExtensionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.ComputeManager; +import java.util.Map; + +/** + * Type representing VirtualMachineExtension. + */ +public interface VirtualMachineExtension extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + VirtualMachineExtensionInstanceView instanceView(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publisher value. + */ + String publisher(); + + /** + * @return the settings value. + */ + Object settings(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * @return the virtualMachineExtensionType value. + */ + String virtualMachineExtensionType(); + + /** + * The entirety of the VirtualMachineExtension definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualMachine, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualMachineExtension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualMachineExtension definition. + */ + interface Blank extends WithVirtualMachine { + } + + /** + * The stage of the virtualmachineextension definition allowing to specify VirtualMachine. + */ + interface WithVirtualMachine { + /** + * Specifies resourceGroupName, vmName. + * @param resourceGroupName The name of the resource group + * @param vmName The name of the virtual machine where the extension should be created or updated + * @return the next definition stage + */ + WithLocation withExistingVirtualMachine(String resourceGroupName, String vmName); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next definition stage + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify EnableAutomaticUpgrade. + */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies enableAutomaticUpgrade. + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available + * @return the next definition stage + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next definition stage + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify InstanceView. + */ + interface WithInstanceView { + /** + * Specifies instanceView. + * @param instanceView The virtual machine extension instance view + * @return the next definition stage + */ + WithCreate withInstanceView(VirtualMachineExtensionInstanceView instanceView); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next definition stage + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next definition stage + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next definition stage + */ + WithCreate withSettings(Object settings); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next definition stage + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + + /** + * The stage of the virtualmachineextension definition allowing to specify VirtualMachineExtensionType. + */ + interface WithVirtualMachineExtensionType { + /** + * Specifies virtualMachineExtensionType. + * @param virtualMachineExtensionType Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next definition stage + */ + WithCreate withVirtualMachineExtensionType(String virtualMachineExtensionType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithEnableAutomaticUpgrade, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithInstanceView, DefinitionStages.WithProtectedSettings, DefinitionStages.WithPublisher, DefinitionStages.WithSettings, DefinitionStages.WithTags, DefinitionStages.WithTypeHandlerVersion, DefinitionStages.WithVirtualMachineExtensionType { + } + } + /** + * The template for a VirtualMachineExtension update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithEnableAutomaticUpgrade, UpdateStages.WithForceUpdateTag, UpdateStages.WithProtectedSettings, UpdateStages.WithPublisher, UpdateStages.WithSettings, UpdateStages.WithTags, UpdateStages.WithType, UpdateStages.WithTypeHandlerVersion { + } + + /** + * Grouping of VirtualMachineExtension update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualmachineextension update allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next update stage + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the virtualmachineextension update allowing to specify EnableAutomaticUpgrade. + */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies enableAutomaticUpgrade. + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available + * @return the next update stage + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + + /** + * The stage of the virtualmachineextension update allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next update stage + */ + Update withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the virtualmachineextension update allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next update stage + */ + Update withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the virtualmachineextension update allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next update stage + */ + Update withPublisher(String publisher); + } + + /** + * The stage of the virtualmachineextension update allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next update stage + */ + Update withSettings(Object settings); + } + + /** + * The stage of the virtualmachineextension update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the virtualmachineextension update allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + * @param type Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next update stage + */ + Update withType(String type); + } + + /** + * The stage of the virtualmachineextension update allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next update stage + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + + } +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtensions.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtensions.java index a2cca7b49a6a..9ec84d603152 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtensions.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineExtensions.java @@ -20,7 +20,7 @@ public interface VirtualMachineExtensions { * @param name resource name. * @return the first stage of the new Extension definition. */ - VirtualMachineVirtualMachineExtension.DefinitionStages.Blank defineExtension(String name); + VirtualMachineExtension.DefinitionStages.Blank defineExtension(String name); /** * The operation to get the extension. @@ -31,7 +31,7 @@ public interface VirtualMachineExtensions { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName); + Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName); /** * The operation to delete the extension. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandInstanceView.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandInstanceView.java new file mode 100644 index 000000000000..530c0cbe57ec --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandInstanceView.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of a virtual machine run command. + */ +public class VirtualMachineRunCommandInstanceView { + /** + * Script execution status. Possible values include: 'Unknown', 'Pending', + * 'Running', 'Failed', 'Succeeded', 'TimedOut', 'Canceled'. + */ + @JsonProperty(value = "executionState") + private ExecutionState executionState; + + /** + * Communicate script configuration errors or execution messages. + */ + @JsonProperty(value = "executionMessage") + private String executionMessage; + + /** + * Exit code returned from script execution. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /** + * Script output stream. + */ + @JsonProperty(value = "output") + private String output; + + /** + * Script error stream. + */ + @JsonProperty(value = "error") + private String error; + + /** + * Script start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Script end time. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get script execution status. Possible values include: 'Unknown', 'Pending', 'Running', 'Failed', 'Succeeded', 'TimedOut', 'Canceled'. + * + * @return the executionState value + */ + public ExecutionState executionState() { + return this.executionState; + } + + /** + * Set script execution status. Possible values include: 'Unknown', 'Pending', 'Running', 'Failed', 'Succeeded', 'TimedOut', 'Canceled'. + * + * @param executionState the executionState value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExecutionState(ExecutionState executionState) { + this.executionState = executionState; + return this; + } + + /** + * Get communicate script configuration errors or execution messages. + * + * @return the executionMessage value + */ + public String executionMessage() { + return this.executionMessage; + } + + /** + * Set communicate script configuration errors or execution messages. + * + * @param executionMessage the executionMessage value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExecutionMessage(String executionMessage) { + this.executionMessage = executionMessage; + return this; + } + + /** + * Get exit code returned from script execution. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set exit code returned from script execution. + * + * @param exitCode the exitCode value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get script output stream. + * + * @return the output value + */ + public String output() { + return this.output; + } + + /** + * Set script output stream. + * + * @param output the output value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withOutput(String output) { + this.output = output; + return this; + } + + /** + * Get script error stream. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Set script error stream. + * + * @param error the error value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withError(String error) { + this.error = error; + return this; + } + + /** + * Get script start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set script start time. + * + * @param startTime the startTime value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get script end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set script end time. + * + * @param endTime the endTime value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the resource status information. + * + * @return the statuses value + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the resource status information. + * + * @param statuses the statuses value to set + * @return the VirtualMachineRunCommandInstanceView object itself. + */ + public VirtualMachineRunCommandInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandScriptSource.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandScriptSource.java new file mode 100644 index 000000000000..441596bd122a --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandScriptSource.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the script sources for run command. + */ +public class VirtualMachineRunCommandScriptSource { + /** + * Specifies the script content to be executed on the VM. + */ + @JsonProperty(value = "script") + private String script; + + /** + * Specifies the script download location. + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /** + * Specifies a commandId of predefined built-in script. + */ + @JsonProperty(value = "commandId") + private String commandId; + + /** + * Get specifies the script content to be executed on the VM. + * + * @return the script value + */ + public String script() { + return this.script; + } + + /** + * Set specifies the script content to be executed on the VM. + * + * @param script the script value to set + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withScript(String script) { + this.script = script; + return this; + } + + /** + * Get specifies the script download location. + * + * @return the scriptUri value + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set specifies the script download location. + * + * @param scriptUri the scriptUri value to set + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withScriptUri(String scriptUri) { + this.scriptUri = scriptUri; + return this; + } + + /** + * Get specifies a commandId of predefined built-in script. + * + * @return the commandId value + */ + public String commandId() { + return this.commandId; + } + + /** + * Set specifies a commandId of predefined built-in script. + * + * @param commandId the commandId value to set + * @return the VirtualMachineRunCommandScriptSource object itself. + */ + public VirtualMachineRunCommandScriptSource withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandUpdate.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandUpdate.java new file mode 100644 index 000000000000..518e6af5e9c5 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommandUpdate.java @@ -0,0 +1,288 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a Virtual Machine run command. + */ +@JsonFlatten +public class VirtualMachineRunCommandUpdate extends UpdateResource { + /** + * The source of the run command script. + */ + @JsonProperty(value = "properties.source") + private VirtualMachineRunCommandScriptSource source; + + /** + * The parameters used by the script. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The parameters used by the script. + */ + @JsonProperty(value = "properties.protectedParameters") + private List protectedParameters; + + /** + * Optional. If set to true, provisioning will complete as soon as the + * script starts and will not wait for script to complete. + */ + @JsonProperty(value = "properties.asyncExecution") + private Boolean asyncExecution; + + /** + * Specifies the user account on the VM when executing the run command. + */ + @JsonProperty(value = "properties.runAsUser") + private String runAsUser; + + /** + * Specifies the user account password on the VM when executing the run + * command. + */ + @JsonProperty(value = "properties.runAsPassword") + private String runAsPassword; + + /** + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "properties.timeoutInSeconds") + private Integer timeoutInSeconds; + + /** + * Specifies the Azure storage blob where script output stream will be + * uploaded. + */ + @JsonProperty(value = "properties.outputBlobUri") + private String outputBlobUri; + + /** + * Specifies the Azure storage blob where script error stream will be + * uploaded. + */ + @JsonProperty(value = "properties.errorBlobUri") + private String errorBlobUri; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The virtual machine run command instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineRunCommandInstanceView instanceView; + + /** + * Get the source of the run command script. + * + * @return the source value + */ + public VirtualMachineRunCommandScriptSource source() { + return this.source; + } + + /** + * Set the source of the run command script. + * + * @param source the source value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withSource(VirtualMachineRunCommandScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the parameters used by the script. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters used by the script. + * + * @param parameters the parameters value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the parameters used by the script. + * + * @return the protectedParameters value + */ + public List protectedParameters() { + return this.protectedParameters; + } + + /** + * Set the parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withProtectedParameters(List protectedParameters) { + this.protectedParameters = protectedParameters; + return this; + } + + /** + * Get optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + * + * @return the asyncExecution value + */ + public Boolean asyncExecution() { + return this.asyncExecution; + } + + /** + * Set optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withAsyncExecution(Boolean asyncExecution) { + this.asyncExecution = asyncExecution; + return this; + } + + /** + * Get specifies the user account on the VM when executing the run command. + * + * @return the runAsUser value + */ + public String runAsUser() { + return this.runAsUser; + } + + /** + * Set specifies the user account on the VM when executing the run command. + * + * @param runAsUser the runAsUser value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withRunAsUser(String runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get specifies the user account password on the VM when executing the run command. + * + * @return the runAsPassword value + */ + public String runAsPassword() { + return this.runAsPassword; + } + + /** + * Set specifies the user account password on the VM when executing the run command. + * + * @param runAsPassword the runAsPassword value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withRunAsPassword(String runAsPassword) { + this.runAsPassword = runAsPassword; + return this; + } + + /** + * Get the timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get specifies the Azure storage blob where script output stream will be uploaded. + * + * @return the outputBlobUri value + */ + public String outputBlobUri() { + return this.outputBlobUri; + } + + /** + * Set specifies the Azure storage blob where script output stream will be uploaded. + * + * @param outputBlobUri the outputBlobUri value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get specifies the Azure storage blob where script error stream will be uploaded. + * + * @return the errorBlobUri value + */ + public String errorBlobUri() { + return this.errorBlobUri; + } + + /** + * Set specifies the Azure storage blob where script error stream will be uploaded. + * + * @param errorBlobUri the errorBlobUri value to set + * @return the VirtualMachineRunCommandUpdate object itself. + */ + public VirtualMachineRunCommandUpdate withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtual machine run command instance view. + * + * @return the instanceView value + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommands.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommands.java index d02a6c1183cd..995e02d7ebd6 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommands.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineRunCommands.java @@ -9,12 +9,20 @@ package com.microsoft.azure.management.compute.v2020_06_01; import rx.Observable; -import com.microsoft.azure.management.compute.v2020_06_01.RunCommandDocument; +import com.microsoft.azure.management.compute.v2020_06_01.LocationVirtualMachineRunCommand; +import rx.Completable; /** * Type representing VirtualMachineRunCommands. */ public interface VirtualMachineRunCommands { + /** + * Begins definition for a new RunCommand resource. + * @param name resource name. + * @return the first stage of the new RunCommand definition. + */ + LocationVirtualMachineRunCommand.DefinitionStages.Blank defineRunCommand(String name); + /** * Gets specific run command for a subscription in a location. * @@ -23,7 +31,7 @@ public interface VirtualMachineRunCommands { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getAsync(String location, String commandId); + Observable getAsync(String location, String commandId); /** * Lists all available run commands for a subscription in a location. @@ -32,6 +40,38 @@ public interface VirtualMachineRunCommands { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listAsync(final String location); + Observable listAsync(final String location); + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String vmName, String runCommandName); + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName); + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVirtualMachineAsync(final String resourceGroupName, final String vmName); } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVM.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVM.java index 6083198030e7..92f54a9b16eb 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVM.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVM.java @@ -117,7 +117,7 @@ public interface VirtualMachineScaleSetVM extends HasInner resources(); + List resources(); /** * @return the securityProfile value. @@ -218,7 +218,7 @@ interface WithHardwareProfile { interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 + * @param licenseType Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 * @return the next update stage */ Update withLicenseType(String licenseType); diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtension.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtension.java new file mode 100644 index 000000000000..134ef1c101b7 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtension.java @@ -0,0 +1,343 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineScaleSetVMExtensionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.ComputeManager; + +/** + * Type representing VirtualMachineScaleSetVMExtension. + */ +public interface VirtualMachineScaleSetVMExtension extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + VirtualMachineExtensionInstanceView instanceView(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publisher value. + */ + String publisher(); + + /** + * @return the settings value. + */ + Object settings(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the type1 value. + */ + String type1(); + + /** + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * The entirety of the VirtualMachineScaleSetVMExtension definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualmachine, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualMachineScaleSetVMExtension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualMachineScaleSetVMExtension definition. + */ + interface Blank extends WithVirtualmachine { + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify Virtualmachine. + */ + interface WithVirtualmachine { + /** + * Specifies resourceGroupName, vmScaleSetName, instanceId. + * @param resourceGroupName The name of the resource group + * @param vmScaleSetName The name of the VM scale set + * @param instanceId The instance ID of the virtual machine + * @return the next definition stage + */ + WithCreate withExistingVirtualmachine(String resourceGroupName, String vmScaleSetName, String instanceId); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next definition stage + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify EnableAutomaticUpgrade. + */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies enableAutomaticUpgrade. + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available + * @return the next definition stage + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next definition stage + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify InstanceView. + */ + interface WithInstanceView { + /** + * Specifies instanceView. + * @param instanceView The virtual machine extension instance view + * @return the next definition stage + */ + WithCreate withInstanceView(VirtualMachineExtensionInstanceView instanceView); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next definition stage + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next definition stage + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next definition stage + */ + WithCreate withSettings(Object settings); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify Type1. + */ + interface WithType1 { + /** + * Specifies type1. + * @param type1 Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next definition stage + */ + WithCreate withType1(String type1); + } + + /** + * The stage of the virtualmachinescalesetvmextension definition allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next definition stage + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithEnableAutomaticUpgrade, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithInstanceView, DefinitionStages.WithProtectedSettings, DefinitionStages.WithPublisher, DefinitionStages.WithSettings, DefinitionStages.WithType1, DefinitionStages.WithTypeHandlerVersion { + } + } + /** + * The template for a VirtualMachineScaleSetVMExtension update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithEnableAutomaticUpgrade, UpdateStages.WithForceUpdateTag, UpdateStages.WithProtectedSettings, UpdateStages.WithPublisher, UpdateStages.WithSettings, UpdateStages.WithType1, UpdateStages.WithTypeHandlerVersion { + } + + /** + * Grouping of VirtualMachineScaleSetVMExtension update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next update stage + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify EnableAutomaticUpgrade. + */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies enableAutomaticUpgrade. + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available + * @return the next update stage + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next update stage + */ + Update withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next update stage + */ + Update withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next update stage + */ + Update withPublisher(String publisher); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next update stage + */ + Update withSettings(Object settings); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify Type1. + */ + interface WithType1 { + /** + * Specifies type1. + * @param type1 Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next update stage + */ + Update withType1(String type1); + } + + /** + * The stage of the virtualmachinescalesetvmextension update allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next update stage + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + + } +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionUpdate.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionUpdate.java new file mode 100644 index 000000000000..a67ed04e26ee --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionUpdate.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a VMSS VM Extension. + */ +@JsonFlatten +public class VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { + /** + * The name of the extension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String type1; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * Get the name of the extension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type1 value + */ + public String type1() { + return this.type1; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type1 the type1 value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withType1(String type1) { + this.type1 = type1; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the VirtualMachineScaleSetVMExtensionUpdate object itself. + */ + public VirtualMachineScaleSetVMExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensions.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensions.java index 2d4daa453c1b..240b5f57b99b 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensions.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensions.java @@ -17,7 +17,7 @@ /** * Type representing VirtualMachineScaleSetVMExtensions. */ -public interface VirtualMachineScaleSetVMExtensions extends SupportsCreating, HasInner { +public interface VirtualMachineScaleSetVMExtensions extends SupportsCreating, HasInner { /** * The operation to get all extensions of an instance in Virtual Machine Scaleset. * @@ -27,7 +27,7 @@ public interface VirtualMachineScaleSetVMExtensions extends SupportsCreating listAsync(String resourceGroupName, String vmScaleSetName, String instanceId); + Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId); /** * The operation to get the VMSS VM extension. @@ -39,7 +39,7 @@ public interface VirtualMachineScaleSetVMExtensions extends SupportsCreating getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); + Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName); /** * The operation to delete the VMSS VM extension. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionsListResult.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionsListResult.java new file mode 100644 index 000000000000..9e51d553a510 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMExtensionsListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.ComputeManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineScaleSetVMExtensionsListResultInner; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineScaleSetVMExtensionInner; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetVMExtensionsListResult. + */ +public interface VirtualMachineScaleSetVMExtensionsListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMProfile.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMProfile.java index 977e70f666cd..97aa94dc0b2b 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMProfile.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMProfile.java @@ -57,14 +57,16 @@ public class VirtualMachineScaleSetVMProfile { /** * Specifies that the image or disk that is being used was licensed - * on-premises. This element is only used for images that contain the - * Windows Server operating system. <br><br> Possible values - * are: <br><br> Windows_Client <br><br> - * Windows_Server <br><br> If this element is included in a - * request for an update, the value must match the initial value. This - * value cannot be updated. <br><br> For more information, see - * [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * on-premises. <br><br> Possible values for Windows Server + * operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values + * for Linux Server operating system are: <br><br> RHEL_BYOS + * (for RHEL) <br><br> SLES_BYOS (for SUSE) + * <br><br> For more information, see [Azure Hybrid Use Benefit + * for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) * <br><br> Minimum api-version: 2015-06-15. */ @JsonProperty(value = "licenseType") @@ -224,7 +226,7 @@ public VirtualMachineScaleSetVMProfile withExtensionProfile(VirtualMachineScaleS } /** - * Get specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Get specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @return the licenseType value */ @@ -233,7 +235,7 @@ public String licenseType() { } /** - * Set specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Set specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @param licenseType the licenseType value to set * @return the VirtualMachineScaleSetVMProfile object itself. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMRunCommands.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMRunCommands.java new file mode 100644 index 000000000000..e0fee6e1cc50 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVMRunCommands.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineScaleSetVMRunCommandsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualMachineScaleSetVMRunCommands. + */ +public interface VirtualMachineScaleSetVMRunCommands extends SupportsCreating, HasInner { + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId); + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName); + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVirtualMachineRunCommand.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVirtualMachineRunCommand.java new file mode 100644 index 000000000000..4eb07d83ad30 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineScaleSetVirtualMachineRunCommand.java @@ -0,0 +1,408 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.VirtualMachineRunCommandInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.compute.v2020_06_01.implementation.ComputeManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing VirtualMachineScaleSetVirtualMachineRunCommand. + */ +public interface VirtualMachineScaleSetVirtualMachineRunCommand extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the asyncExecution value. + */ + Boolean asyncExecution(); + + /** + * @return the errorBlobUri value. + */ + String errorBlobUri(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + VirtualMachineRunCommandInstanceView instanceView(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputBlobUri value. + */ + String outputBlobUri(); + + /** + * @return the parameters value. + */ + List parameters(); + + /** + * @return the protectedParameters value. + */ + List protectedParameters(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the runAsPassword value. + */ + String runAsPassword(); + + /** + * @return the runAsUser value. + */ + String runAsUser(); + + /** + * @return the source value. + */ + VirtualMachineRunCommandScriptSource source(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeoutInSeconds value. + */ + Integer timeoutInSeconds(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the VirtualMachineScaleSetVirtualMachineRunCommand definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVirtualmachine, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualMachineScaleSetVirtualMachineRunCommand definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualMachineScaleSetVirtualMachineRunCommand definition. + */ + interface Blank extends WithVirtualmachine { + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify Virtualmachine. + */ + interface WithVirtualmachine { + /** + * Specifies resourceGroupName, vmScaleSetName, instanceId. + * @param resourceGroupName The name of the resource group + * @param vmScaleSetName The name of the VM scale set + * @param instanceId The instance ID of the virtual machine + * @return the next definition stage + */ + WithLocation withExistingVirtualmachine(String resourceGroupName, String vmScaleSetName, String instanceId); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify AsyncExecution. + */ + interface WithAsyncExecution { + /** + * Specifies asyncExecution. + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete + * @return the next definition stage + */ + WithCreate withAsyncExecution(Boolean asyncExecution); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify ErrorBlobUri. + */ + interface WithErrorBlobUri { + /** + * Specifies errorBlobUri. + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded + * @return the next definition stage + */ + WithCreate withErrorBlobUri(String errorBlobUri); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify OutputBlobUri. + */ + interface WithOutputBlobUri { + /** + * Specifies outputBlobUri. + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded + * @return the next definition stage + */ + WithCreate withOutputBlobUri(String outputBlobUri); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify Parameters. + */ + interface WithParameters { + /** + * Specifies parameters. + * @param parameters The parameters used by the script + * @return the next definition stage + */ + WithCreate withParameters(List parameters); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify ProtectedParameters. + */ + interface WithProtectedParameters { + /** + * Specifies protectedParameters. + * @param protectedParameters The parameters used by the script + * @return the next definition stage + */ + WithCreate withProtectedParameters(List protectedParameters); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify RunAsPassword. + */ + interface WithRunAsPassword { + /** + * Specifies runAsPassword. + * @param runAsPassword Specifies the user account password on the VM when executing the run command + * @return the next definition stage + */ + WithCreate withRunAsPassword(String runAsPassword); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify RunAsUser. + */ + interface WithRunAsUser { + /** + * Specifies runAsUser. + * @param runAsUser Specifies the user account on the VM when executing the run command + * @return the next definition stage + */ + WithCreate withRunAsUser(String runAsUser); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The source of the run command script + * @return the next definition stage + */ + WithCreate withSource(VirtualMachineRunCommandScriptSource source); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand definition allowing to specify TimeoutInSeconds. + */ + interface WithTimeoutInSeconds { + /** + * Specifies timeoutInSeconds. + * @param timeoutInSeconds The timeout in seconds to execute the run command + * @return the next definition stage + */ + WithCreate withTimeoutInSeconds(Integer timeoutInSeconds); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAsyncExecution, DefinitionStages.WithErrorBlobUri, DefinitionStages.WithOutputBlobUri, DefinitionStages.WithParameters, DefinitionStages.WithProtectedParameters, DefinitionStages.WithRunAsPassword, DefinitionStages.WithRunAsUser, DefinitionStages.WithSource, DefinitionStages.WithTags, DefinitionStages.WithTimeoutInSeconds { + } + } + /** + * The template for a VirtualMachineScaleSetVirtualMachineRunCommand update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAsyncExecution, UpdateStages.WithErrorBlobUri, UpdateStages.WithOutputBlobUri, UpdateStages.WithParameters, UpdateStages.WithProtectedParameters, UpdateStages.WithRunAsPassword, UpdateStages.WithRunAsUser, UpdateStages.WithSource, UpdateStages.WithTags, UpdateStages.WithTimeoutInSeconds { + } + + /** + * Grouping of VirtualMachineScaleSetVirtualMachineRunCommand update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify AsyncExecution. + */ + interface WithAsyncExecution { + /** + * Specifies asyncExecution. + * @param asyncExecution Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete + * @return the next update stage + */ + Update withAsyncExecution(Boolean asyncExecution); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify ErrorBlobUri. + */ + interface WithErrorBlobUri { + /** + * Specifies errorBlobUri. + * @param errorBlobUri Specifies the Azure storage blob where script error stream will be uploaded + * @return the next update stage + */ + Update withErrorBlobUri(String errorBlobUri); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify OutputBlobUri. + */ + interface WithOutputBlobUri { + /** + * Specifies outputBlobUri. + * @param outputBlobUri Specifies the Azure storage blob where script output stream will be uploaded + * @return the next update stage + */ + Update withOutputBlobUri(String outputBlobUri); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify Parameters. + */ + interface WithParameters { + /** + * Specifies parameters. + * @param parameters The parameters used by the script + * @return the next update stage + */ + Update withParameters(List parameters); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify ProtectedParameters. + */ + interface WithProtectedParameters { + /** + * Specifies protectedParameters. + * @param protectedParameters The parameters used by the script + * @return the next update stage + */ + Update withProtectedParameters(List protectedParameters); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify RunAsPassword. + */ + interface WithRunAsPassword { + /** + * Specifies runAsPassword. + * @param runAsPassword Specifies the user account password on the VM when executing the run command + * @return the next update stage + */ + Update withRunAsPassword(String runAsPassword); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify RunAsUser. + */ + interface WithRunAsUser { + /** + * Specifies runAsUser. + * @param runAsUser Specifies the user account on the VM when executing the run command + * @return the next update stage + */ + Update withRunAsUser(String runAsUser); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The source of the run command script + * @return the next update stage + */ + Update withSource(VirtualMachineRunCommandScriptSource source); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the virtualmachinescalesetvirtualmachineruncommand update allowing to specify TimeoutInSeconds. + */ + interface WithTimeoutInSeconds { + /** + * Specifies timeoutInSeconds. + * @param timeoutInSeconds The timeout in seconds to execute the run command + * @return the next update stage + */ + Update withTimeoutInSeconds(Integer timeoutInSeconds); + } + + } +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineUpdate.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineUpdate.java index 062dc0779d99..21f24b903feb 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineUpdate.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachineUpdate.java @@ -174,14 +174,16 @@ public class VirtualMachineUpdate extends UpdateResource { /** * Specifies that the image or disk that is being used was licensed - * on-premises. This element is only used for images that contain the - * Windows Server operating system. <br><br> Possible values - * are: <br><br> Windows_Client <br><br> - * Windows_Server <br><br> If this element is included in a - * request for an update, the value must match the initial value. This - * value cannot be updated. <br><br> For more information, see - * [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * on-premises. <br><br> Possible values for Windows Server + * operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values + * for Linux Server operating system are: <br><br> RHEL_BYOS + * (for RHEL) <br><br> SLES_BYOS (for SUSE) + * <br><br> For more information, see [Azure Hybrid Use Benefit + * for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) * <br><br> Minimum api-version: 2015-06-15. */ @JsonProperty(value = "properties.licenseType") @@ -555,7 +557,7 @@ public VirtualMachineInstanceViewInner instanceView() { } /** - * Get specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Get specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @return the licenseType value */ @@ -564,7 +566,7 @@ public String licenseType() { } /** - * Set specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Set specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @param licenseType the licenseType value to set * @return the VirtualMachineUpdate object itself. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManagementClientImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManagementClientImpl.java index 3bdb5e19d927..a351a5617f7f 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManagementClientImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManagementClientImpl.java @@ -382,6 +382,19 @@ public VirtualMachineRunCommandsInner virtualMachineRunCommands() { return this.virtualMachineRunCommands; } + /** + * The VirtualMachineScaleSetVMRunCommandsInner object to access its operations. + */ + private VirtualMachineScaleSetVMRunCommandsInner virtualMachineScaleSetVMRunCommands; + + /** + * Gets the VirtualMachineScaleSetVMRunCommandsInner object to access its operations. + * @return the VirtualMachineScaleSetVMRunCommandsInner object. + */ + public VirtualMachineScaleSetVMRunCommandsInner virtualMachineScaleSetVMRunCommands() { + return this.virtualMachineScaleSetVMRunCommands; + } + /** * The ResourceSkusInner object to access its operations. */ @@ -579,6 +592,7 @@ protected void initialize() { this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsInner(restClient().retrofit(), this); this.logAnalytics = new LogAnalyticsInner(restClient().retrofit(), this); this.virtualMachineRunCommands = new VirtualMachineRunCommandsInner(restClient().retrofit(), this); + this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsInner(restClient().retrofit(), this); this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); this.disks = new DisksInner(restClient().retrofit(), this); this.snapshots = new SnapshotsInner(restClient().retrofit(), this); diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManager.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManager.java index 53afc22019f5..73db0dfc8e97 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManager.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ComputeManager.java @@ -36,6 +36,7 @@ import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMs; import com.microsoft.azure.management.compute.v2020_06_01.LogAnalytics; import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands; import com.microsoft.azure.management.compute.v2020_06_01.ResourceSkus; import com.microsoft.azure.management.compute.v2020_06_01.Disks; import com.microsoft.azure.management.compute.v2020_06_01.Snapshots; @@ -74,6 +75,7 @@ public final class ComputeManager extends ManagerCore implements LocationVirtualMachineRunCommand, LocationVirtualMachineRunCommand.Definition, LocationVirtualMachineRunCommand.Update { + private final ComputeManager manager; + private String resourceGroupName; + private String vmName; + private String runCommandName; + private VirtualMachineRunCommandUpdate updateParameter; + + LocationVirtualMachineRunCommandImpl(String name, ComputeManager manager) { + super(name, new VirtualMachineRunCommandInner()); + this.manager = manager; + // Set resource name + this.runCommandName = name; + // + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + LocationVirtualMachineRunCommandImpl(VirtualMachineRunCommandInner inner, ComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.runCommandName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.vmName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.runCommandName = IdParsingUtils.getValueFromIdByName(inner.id(), "runCommands"); + // + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + @Override + public ComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualMachineRunCommandsInner client = this.manager().inner().virtualMachineRunCommands(); + return client.createOrUpdateAsync(this.resourceGroupName, this.vmName, this.runCommandName, this.inner()) + .map(new Func1() { + @Override + public VirtualMachineRunCommandInner call(VirtualMachineRunCommandInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualMachineRunCommandsInner client = this.manager().inner().virtualMachineRunCommands(); + return client.updateAsync(this.resourceGroupName, this.vmName, this.runCommandName, this.updateParameter) + .map(new Func1() { + @Override + public VirtualMachineRunCommandInner call(VirtualMachineRunCommandInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualMachineRunCommandsInner client = this.manager().inner().virtualMachineRunCommands(); + return client.getAsync(this.resourceGroupName, this.vmName, this.runCommandName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + @Override + public Boolean asyncExecution() { + return this.inner().asyncExecution(); + } + + @Override + public String errorBlobUri() { + return this.inner().errorBlobUri(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public VirtualMachineRunCommandInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String outputBlobUri() { + return this.inner().outputBlobUri(); + } + + @Override + public List parameters() { + return this.inner().parameters(); + } + + @Override + public List protectedParameters() { + return this.inner().protectedParameters(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String runAsPassword() { + return this.inner().runAsPassword(); + } + + @Override + public String runAsUser() { + return this.inner().runAsUser(); + } + + @Override + public VirtualMachineRunCommandScriptSource source() { + return this.inner().source(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Integer timeoutInSeconds() { + return this.inner().timeoutInSeconds(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public LocationVirtualMachineRunCommandImpl withExistingLocation(String resourceGroupName, String vmName) { + this.resourceGroupName = resourceGroupName; + this.vmName = vmName; + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withAsyncExecution(Boolean asyncExecution) { + if (isInCreateMode()) { + this.inner().withAsyncExecution(asyncExecution); + } else { + this.updateParameter.withAsyncExecution(asyncExecution); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withErrorBlobUri(String errorBlobUri) { + if (isInCreateMode()) { + this.inner().withErrorBlobUri(errorBlobUri); + } else { + this.updateParameter.withErrorBlobUri(errorBlobUri); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withOutputBlobUri(String outputBlobUri) { + if (isInCreateMode()) { + this.inner().withOutputBlobUri(outputBlobUri); + } else { + this.updateParameter.withOutputBlobUri(outputBlobUri); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withParameters(List parameters) { + if (isInCreateMode()) { + this.inner().withParameters(parameters); + } else { + this.updateParameter.withParameters(parameters); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withProtectedParameters(List protectedParameters) { + if (isInCreateMode()) { + this.inner().withProtectedParameters(protectedParameters); + } else { + this.updateParameter.withProtectedParameters(protectedParameters); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withRunAsPassword(String runAsPassword) { + if (isInCreateMode()) { + this.inner().withRunAsPassword(runAsPassword); + } else { + this.updateParameter.withRunAsPassword(runAsPassword); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withRunAsUser(String runAsUser) { + if (isInCreateMode()) { + this.inner().withRunAsUser(runAsUser); + } else { + this.updateParameter.withRunAsUser(runAsUser); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withSource(VirtualMachineRunCommandScriptSource source) { + if (isInCreateMode()) { + this.inner().withSource(source); + } else { + this.updateParameter.withSource(source); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public LocationVirtualMachineRunCommandImpl withTimeoutInSeconds(Integer timeoutInSeconds) { + if (isInCreateMode()) { + this.inner().withTimeoutInSeconds(timeoutInSeconds); + } else { + this.updateParameter.withTimeoutInSeconds(timeoutInSeconds); + } + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ProximityPlacementGroupImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ProximityPlacementGroupImpl.java index 3021eb6b9d82..8b585d3c5e78 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ProximityPlacementGroupImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/ProximityPlacementGroupImpl.java @@ -18,6 +18,7 @@ import com.microsoft.azure.management.compute.v2020_06_01.InstanceViewStatus; class ProximityPlacementGroupImpl extends GroupableResourceCoreImpl implements ProximityPlacementGroup, ProximityPlacementGroup.Definition, ProximityPlacementGroup.Update { + private Map utags; ProximityPlacementGroupImpl(String name, ProximityPlacementGroupInner inner, ComputeManager manager) { super(name, inner, manager); } @@ -32,7 +33,7 @@ public Observable createResourceAsync() { @Override public Observable updateResourceAsync() { ProximityPlacementGroupsInner client = this.manager().inner().proximityPlacementGroups(); - return client.updateAsync(this.resourceGroupName(), this.name(), this.tags()) + return client.updateAsync(this.resourceGroupName(), this.name(), this.utags) .map(innerToFluentMap(this)); } @@ -84,4 +85,11 @@ public ProximityPlacementGroupImpl withProximityPlacementGroupType(ProximityPlac this.inner().withProximityPlacementGroupType(proximityPlacementGroupType); return this; } + + @Override + public ProximityPlacementGroupImpl withTags(Map tags) { + this.utags = tags; + return this; + } + } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionImpl.java new file mode 100644 index 000000000000..2a0ab524fe27 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionImpl.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtension; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionUpdate; +import java.util.Map; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionInstanceView; +import rx.functions.Func1; + +class VirtualMachineExtensionImpl extends CreatableUpdatableImpl implements VirtualMachineExtension, VirtualMachineExtension.Definition, VirtualMachineExtension.Update { + private final ComputeManager manager; + private String resourceGroupName; + private String vmName; + private String vmExtensionName; + private VirtualMachineExtensionUpdate updateParameter; + + VirtualMachineExtensionImpl(String name, ComputeManager manager) { + super(name, new VirtualMachineExtensionInner()); + this.manager = manager; + // Set resource name + this.vmExtensionName = name; + // + this.updateParameter = new VirtualMachineExtensionUpdate(); + } + + VirtualMachineExtensionImpl(VirtualMachineExtensionInner inner, ComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.vmExtensionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.vmName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.vmExtensionName = IdParsingUtils.getValueFromIdByName(inner.id(), "extensions"); + // + this.updateParameter = new VirtualMachineExtensionUpdate(); + } + + @Override + public ComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualMachineExtensionsInner client = this.manager().inner().virtualMachineExtensions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.vmName, this.vmExtensionName, this.inner()) + .map(new Func1() { + @Override + public VirtualMachineExtensionInner call(VirtualMachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualMachineExtensionsInner client = this.manager().inner().virtualMachineExtensions(); + return client.updateAsync(this.resourceGroupName, this.vmName, this.vmExtensionName, this.updateParameter) + .map(new Func1() { + @Override + public VirtualMachineExtensionInner call(VirtualMachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualMachineExtensionsInner client = this.manager().inner().virtualMachineExtensions(); + return client.getAsync(this.resourceGroupName, this.vmName, this.vmExtensionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VirtualMachineExtensionUpdate(); + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public Boolean enableAutomaticUpgrade() { + return this.inner().enableAutomaticUpgrade(); + } + + @Override + public String forceUpdateTag() { + return this.inner().forceUpdateTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public VirtualMachineExtensionInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object protectedSettings() { + return this.inner().protectedSettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publisher() { + return this.inner().publisher(); + } + + @Override + public Object settings() { + return this.inner().settings(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String typeHandlerVersion() { + return this.inner().typeHandlerVersion(); + } + + @Override + public String virtualMachineExtensionType() { + return this.inner().virtualMachineExtensionType(); + } + + @Override + public VirtualMachineExtensionImpl withExistingVirtualMachine(String resourceGroupName, String vmName) { + this.resourceGroupName = resourceGroupName; + this.vmName = vmName; + return this; + } + + @Override + public VirtualMachineExtensionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VirtualMachineExtensionImpl withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.inner().withInstanceView(instanceView); + return this; + } + + @Override + public VirtualMachineExtensionImpl withVirtualMachineExtensionType(String virtualMachineExtensionType) { + this.inner().withVirtualMachineExtensionType(virtualMachineExtensionType); + return this; + } + + @Override + public VirtualMachineExtensionImpl withType(String type) { + this.updateParameter.withType(type); + return this; + } + + @Override + public VirtualMachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.inner().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } else { + this.updateParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.inner().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + } else { + this.updateParameter.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.inner().withForceUpdateTag(forceUpdateTag); + } else { + this.updateParameter.withForceUpdateTag(forceUpdateTag); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.inner().withProtectedSettings(protectedSettings); + } else { + this.updateParameter.withProtectedSettings(protectedSettings); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.inner().withPublisher(publisher); + } else { + this.updateParameter.withPublisher(publisher); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.inner().withSettings(settings); + } else { + this.updateParameter.withSettings(settings); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public VirtualMachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.inner().withTypeHandlerVersion(typeHandlerVersion); + } else { + this.updateParameter.withTypeHandlerVersion(typeHandlerVersion); + } + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionsImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionsImpl.java index 99235d6e213e..49d1b3b3e01f 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionsImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineExtensionsImpl.java @@ -13,7 +13,7 @@ import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensions; import rx.Observable; import rx.functions.Func1; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineVirtualMachineExtension; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtension; import rx.Completable; import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionsListResult; @@ -30,16 +30,16 @@ public ComputeManager manager() { } @Override - public VirtualMachineVirtualMachineExtensionImpl defineExtension(String name) { + public VirtualMachineExtensionImpl defineExtension(String name) { return wrapExtensionModel(name); } - private VirtualMachineVirtualMachineExtensionImpl wrapExtensionModel(String name) { - return new VirtualMachineVirtualMachineExtensionImpl(name, this.manager()); + private VirtualMachineExtensionImpl wrapExtensionModel(String name) { + return new VirtualMachineExtensionImpl(name, this.manager()); } - private VirtualMachineVirtualMachineExtensionImpl wrapVirtualMachineVirtualMachineExtensionModel(VirtualMachineExtensionInner inner) { - return new VirtualMachineVirtualMachineExtensionImpl(inner, manager()); + private VirtualMachineExtensionImpl wrapVirtualMachineExtensionModel(VirtualMachineExtensionInner inner) { + return new VirtualMachineExtensionImpl(inner, manager()); } private Observable getVirtualMachineExtensionInnerUsingVirtualMachineExtensionsInnerAsync(String id) { @@ -51,16 +51,16 @@ private Observable getVirtualMachineExtensionInner } @Override - public Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName) { VirtualMachineExtensionsInner client = this.inner(); return client.getAsync(resourceGroupName, vmName, vmExtensionName) - .flatMap(new Func1>() { + .flatMap(new Func1>() { @Override - public Observable call(VirtualMachineExtensionInner inner) { + public Observable call(VirtualMachineExtensionInner inner) { if (inner == null) { return Observable.empty(); } else { - return Observable.just((VirtualMachineVirtualMachineExtension)wrapVirtualMachineVirtualMachineExtensionModel(inner)); + return Observable.just((VirtualMachineExtension)wrapVirtualMachineExtensionModel(inner)); } } }); diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineImpl.java index a92410fbfa5c..a3c82c79deb6 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineImpl.java @@ -29,7 +29,7 @@ import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineIdentity; import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineInstanceView; import java.util.ArrayList; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineVirtualMachineExtension; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtension; import rx.functions.Func1; class VirtualMachineImpl extends CreatableUpdatableImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { @@ -218,11 +218,11 @@ public SubResource proximityPlacementGroup() { } @Override - public List resources() { - List lst = new ArrayList(); + public List resources() { + List lst = new ArrayList(); if (this.inner().resources() != null) { for (VirtualMachineExtensionInner inner : this.inner().resources()) { - lst.add( new VirtualMachineVirtualMachineExtensionImpl(inner, manager())); + lst.add( new VirtualMachineExtensionImpl(inner, manager())); } } return lst; @@ -264,7 +264,7 @@ public List zones() { } @Override - public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { + public VirtualMachineImpl withExistingLocation(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineInner.java index f1c8ffa1a1a4..5b46a7aecadc 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineInner.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineInner.java @@ -186,14 +186,16 @@ public class VirtualMachineInner extends Resource { /** * Specifies that the image or disk that is being used was licensed - * on-premises. This element is only used for images that contain the - * Windows Server operating system. <br><br> Possible values - * are: <br><br> Windows_Client <br><br> - * Windows_Server <br><br> If this element is included in a - * request for an update, the value must match the initial value. This - * value cannot be updated. <br><br> For more information, see - * [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * on-premises. <br><br> Possible values for Windows Server + * operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values + * for Linux Server operating system are: <br><br> RHEL_BYOS + * (for RHEL) <br><br> SLES_BYOS (for SUSE) + * <br><br> For more information, see [Azure Hybrid Use Benefit + * for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) * <br><br> Minimum api-version: 2015-06-15. */ @JsonProperty(value = "properties.licenseType") @@ -573,7 +575,7 @@ public VirtualMachineInstanceViewInner instanceView() { } /** - * Get specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Get specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @return the licenseType value */ @@ -582,7 +584,7 @@ public String licenseType() { } /** - * Set specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Set specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @param licenseType the licenseType value to set * @return the VirtualMachineInner object itself. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandInner.java new file mode 100644 index 000000000000..8691eaa52ba8 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandInner.java @@ -0,0 +1,292 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandScriptSource; +import java.util.List; +import com.microsoft.azure.management.compute.v2020_06_01.RunCommandInputParameter; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Describes a Virtual Machine run command. + */ +@JsonFlatten +public class VirtualMachineRunCommandInner extends Resource { + /** + * The source of the run command script. + */ + @JsonProperty(value = "properties.source") + private VirtualMachineRunCommandScriptSource source; + + /** + * The parameters used by the script. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The parameters used by the script. + */ + @JsonProperty(value = "properties.protectedParameters") + private List protectedParameters; + + /** + * Optional. If set to true, provisioning will complete as soon as the + * script starts and will not wait for script to complete. + */ + @JsonProperty(value = "properties.asyncExecution") + private Boolean asyncExecution; + + /** + * Specifies the user account on the VM when executing the run command. + */ + @JsonProperty(value = "properties.runAsUser") + private String runAsUser; + + /** + * Specifies the user account password on the VM when executing the run + * command. + */ + @JsonProperty(value = "properties.runAsPassword") + private String runAsPassword; + + /** + * The timeout in seconds to execute the run command. + */ + @JsonProperty(value = "properties.timeoutInSeconds") + private Integer timeoutInSeconds; + + /** + * Specifies the Azure storage blob where script output stream will be + * uploaded. + */ + @JsonProperty(value = "properties.outputBlobUri") + private String outputBlobUri; + + /** + * Specifies the Azure storage blob where script error stream will be + * uploaded. + */ + @JsonProperty(value = "properties.errorBlobUri") + private String errorBlobUri; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The virtual machine run command instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineRunCommandInstanceView instanceView; + + /** + * Get the source of the run command script. + * + * @return the source value + */ + public VirtualMachineRunCommandScriptSource source() { + return this.source; + } + + /** + * Set the source of the run command script. + * + * @param source the source value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withSource(VirtualMachineRunCommandScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the parameters used by the script. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters used by the script. + * + * @param parameters the parameters value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the parameters used by the script. + * + * @return the protectedParameters value + */ + public List protectedParameters() { + return this.protectedParameters; + } + + /** + * Set the parameters used by the script. + * + * @param protectedParameters the protectedParameters value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withProtectedParameters(List protectedParameters) { + this.protectedParameters = protectedParameters; + return this; + } + + /** + * Get optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + * + * @return the asyncExecution value + */ + public Boolean asyncExecution() { + return this.asyncExecution; + } + + /** + * Set optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + * + * @param asyncExecution the asyncExecution value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withAsyncExecution(Boolean asyncExecution) { + this.asyncExecution = asyncExecution; + return this; + } + + /** + * Get specifies the user account on the VM when executing the run command. + * + * @return the runAsUser value + */ + public String runAsUser() { + return this.runAsUser; + } + + /** + * Set specifies the user account on the VM when executing the run command. + * + * @param runAsUser the runAsUser value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withRunAsUser(String runAsUser) { + this.runAsUser = runAsUser; + return this; + } + + /** + * Get specifies the user account password on the VM when executing the run command. + * + * @return the runAsPassword value + */ + public String runAsPassword() { + return this.runAsPassword; + } + + /** + * Set specifies the user account password on the VM when executing the run command. + * + * @param runAsPassword the runAsPassword value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withRunAsPassword(String runAsPassword) { + this.runAsPassword = runAsPassword; + return this; + } + + /** + * Get the timeout in seconds to execute the run command. + * + * @return the timeoutInSeconds value + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeout in seconds to execute the run command. + * + * @param timeoutInSeconds the timeoutInSeconds value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get specifies the Azure storage blob where script output stream will be uploaded. + * + * @return the outputBlobUri value + */ + public String outputBlobUri() { + return this.outputBlobUri; + } + + /** + * Set specifies the Azure storage blob where script output stream will be uploaded. + * + * @param outputBlobUri the outputBlobUri value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withOutputBlobUri(String outputBlobUri) { + this.outputBlobUri = outputBlobUri; + return this; + } + + /** + * Get specifies the Azure storage blob where script error stream will be uploaded. + * + * @return the errorBlobUri value + */ + public String errorBlobUri() { + return this.errorBlobUri; + } + + /** + * Set specifies the Azure storage blob where script error stream will be uploaded. + * + * @param errorBlobUri the errorBlobUri value to set + * @return the VirtualMachineRunCommandInner object itself. + */ + public VirtualMachineRunCommandInner withErrorBlobUri(String errorBlobUri) { + this.errorBlobUri = errorBlobUri; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtual machine run command instance view. + * + * @return the instanceView value + */ + public VirtualMachineRunCommandInstanceView instanceView() { + return this.instanceView; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsImpl.java index 017143a786e9..339d139bd2e1 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsImpl.java @@ -13,8 +13,9 @@ import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands; import rx.Observable; import rx.functions.Func1; -import com.microsoft.azure.management.compute.v2020_06_01.RunCommandDocument; +import com.microsoft.azure.management.compute.v2020_06_01.LocationVirtualMachineRunCommand; import com.microsoft.azure.Page; +import rx.Completable; class VirtualMachineRunCommandsImpl extends WrapperImpl implements VirtualMachineRunCommands { private final ComputeManager manager; @@ -28,11 +29,20 @@ public ComputeManager manager() { return this.manager; } - private RunCommandDocumentImpl wrapRunCommandDocumentModel(RunCommandDocumentInner inner) { - return new RunCommandDocumentImpl(inner, manager()); + @Override + public LocationVirtualMachineRunCommandImpl defineRunCommand(String name) { + return wrapRunCommandModel(name); + } + + private LocationVirtualMachineRunCommandImpl wrapRunCommandModel(String name) { + return new LocationVirtualMachineRunCommandImpl(name, this.manager()); } - private Observable getRunCommandDocumentInnerUsingVirtualMachineRunCommandsInnerAsync(String id) { + private LocationVirtualMachineRunCommandImpl wrapLocationVirtualMachineRunCommandModel(VirtualMachineRunCommandInner inner) { + return new LocationVirtualMachineRunCommandImpl(inner, manager()); + } + + private Observable getVirtualMachineRunCommandInnerUsingVirtualMachineRunCommandsInnerAsync(String id) { String location = IdParsingUtils.getValueFromIdByName(id, "locations"); String commandId = IdParsingUtils.getValueFromIdByName(id, "runCommands"); VirtualMachineRunCommandsInner client = this.inner(); @@ -40,23 +50,23 @@ private Observable getRunCommandDocumentInnerUsingVirtu } @Override - public Observable getAsync(String location, String commandId) { + public Observable getAsync(String location, String commandId) { VirtualMachineRunCommandsInner client = this.inner(); return client.getAsync(location, commandId) - .flatMap(new Func1>() { + .flatMap(new Func1>() { @Override - public Observable call(RunCommandDocumentInner inner) { + public Observable call(VirtualMachineRunCommandInner inner) { if (inner == null) { return Observable.empty(); } else { - return Observable.just((RunCommandDocument)wrapRunCommandDocumentModel(inner)); + return Observable.just((LocationVirtualMachineRunCommand)wrapLocationVirtualMachineRunCommandModel(inner)); } } }); } @Override - public Observable listAsync(final String location) { + public Observable listAsync(final String location) { VirtualMachineRunCommandsInner client = this.inner(); return client.listAsync(location) .flatMapIterable(new Func1, Iterable>() { @@ -65,16 +75,46 @@ public Iterable call(Page>() { + .map(new Func1() { + @Override + public LocationVirtualMachineRunCommand call(VirtualMachineRunCommandInner inner) { + return wrapLocationVirtualMachineRunCommandModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String vmName, String runCommandName) { + VirtualMachineRunCommandsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, vmName, runCommandName).toCompletable(); + } + + @Override + public Observable getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName) { + VirtualMachineRunCommandsInner client = this.inner(); + return client.getByVirtualMachineAsync(resourceGroupName, vmName, runCommandName) + .map(new Func1() { + @Override + public LocationVirtualMachineRunCommand call(VirtualMachineRunCommandInner inner) { + return new LocationVirtualMachineRunCommandImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByVirtualMachineAsync(final String resourceGroupName, final String vmName) { + VirtualMachineRunCommandsInner client = this.inner(); + return client.listByVirtualMachineAsync(resourceGroupName, vmName) + .flatMapIterable(new Func1, Iterable>() { @Override - public Observable call(RunCommandDocumentBaseInner inner) { - return getRunCommandDocumentInnerUsingVirtualMachineRunCommandsInnerAsync(inner.id()); + public Iterable call(Page page) { + return page.items(); } }) - .map(new Func1() { + .map(new Func1() { @Override - public RunCommandDocument call(RunCommandDocumentInner inner) { - return wrapRunCommandDocumentModel(inner); + public LocationVirtualMachineRunCommand call(VirtualMachineRunCommandInner inner) { + return new LocationVirtualMachineRunCommandImpl(inner, manager()); } }); } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsInner.java index 5a131d430f02..026628753cbf 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsInner.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineRunCommandsInner.java @@ -13,18 +13,24 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; +import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; import retrofit2.http.Path; +import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; import retrofit2.Response; @@ -65,10 +71,46 @@ interface VirtualMachineRunCommandsService { @GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}") Observable> get(@Path("location") String location, @Path("commandId") String commandId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandInner runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandInner runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandUpdate runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandUpdate runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands getByVirtualMachine" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}") + Observable> getByVirtualMachine(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands listByVirtualMachine" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands") + Observable> listByVirtualMachine(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommands listByVirtualMachineNext" }) + @GET + Observable> listByVirtualMachineNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -269,102 +311,354 @@ private ServiceResponse getDelegate(Response listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { + public VirtualMachineRunCommandInner createOrUpdate(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).toBlocking().last().body(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { @Override - public Page nextPage(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); } - }; + }); } /** - * Lists all available run commands for a subscription in a location. + * The operation to create or update the run command. * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner beginCreateOrUpdate(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).toBlocking().single().body(); + } + + /** + * The operation to create or update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand), serviceCallback); } /** - * Lists all available run commands for a subscription in a location. + * The operation to create or update the run command. * - * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<RunCommandDocumentBaseInner> object + * @return the observable to the VirtualMachineRunCommandInner object */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Lists all available run commands for a subscription in a location. + * The operation to create or update the run command. * - * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be created or updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<RunCommandDocumentBaseInner> object + * @return the observable to the VirtualMachineRunCommandInner object */ - public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandInner runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); } - return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Lists all available run commands for a subscription in a location. + * The operation to update the run command. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<RunCommandDocumentBaseInner> object wrapped in {@link ServiceResponse} if successful. + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + public VirtualMachineRunCommandInner update(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).toBlocking().last().body(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + Observable> observable = service.update(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner beginUpdate(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).toBlocking().single().body(); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be updated. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + return service.beginUpdate(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -372,9 +666,817 @@ public Observable>> call(Respo }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vmName, String runCommandName) { + deleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).toBlocking().last().body(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vmName, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName), serviceCallback); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vmName, String runCommandName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + Observable> observable = service.delete(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vmName, String runCommandName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).toBlocking().single().body(); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName), serviceCallback); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vmName, String runCommandName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the run command should be deleted. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.beginDelete(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner getByVirtualMachine(String resourceGroupName, String vmName, String runCommandName) { + return getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).toBlocking().single().body(); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName), serviceCallback); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName) { + return getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> getByVirtualMachineWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + final String expand = null; + return service.getByVirtualMachine(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByVirtualMachineDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner getByVirtualMachine(String resourceGroupName, String vmName, String runCommandName, String expand) { + return getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, expand).toBlocking().single().body(); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, expand), serviceCallback); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable getByVirtualMachineAsync(String resourceGroupName, String vmName, String runCommandName, String expand) { + return getByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, runCommandName, expand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> getByVirtualMachineWithServiceResponseAsync(String resourceGroupName, String vmName, String runCommandName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.getByVirtualMachine(resourceGroupName, vmName, runCommandName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByVirtualMachineDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByVirtualMachineDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList listByVirtualMachine(final String resourceGroupName, final String vmName) { + ServiceResponse> response = listByVirtualMachineSinglePageAsync(resourceGroupName, vmName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualMachineAsync(final String resourceGroupName, final String vmName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualMachineSinglePageAsync(resourceGroupName, vmName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listByVirtualMachineAsync(final String resourceGroupName, final String vmName) { + return listByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listByVirtualMachineWithServiceResponseAsync(final String resourceGroupName, final String vmName) { + return listByVirtualMachineSinglePageAsync(resourceGroupName, vmName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualMachineNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualMachineSinglePageAsync(final String resourceGroupName, final String vmName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + final String expand = null; + return service.listByVirtualMachine(resourceGroupName, vmName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualMachineDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList listByVirtualMachine(final String resourceGroupName, final String vmName, final String expand) { + ServiceResponse> response = listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualMachineAsync(final String resourceGroupName, final String vmName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listByVirtualMachineAsync(final String resourceGroupName, final String vmName, final String expand) { + return listByVirtualMachineWithServiceResponseAsync(resourceGroupName, vmName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listByVirtualMachineWithServiceResponseAsync(final String resourceGroupName, final String vmName, final String expand) { + return listByVirtualMachineSinglePageAsync(resourceGroupName, vmName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualMachineNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param vmName The name of the virtual machine containing the run command. + ServiceResponse> * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualMachineSinglePageAsync(final String resourceGroupName, final String vmName, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.listByVirtualMachine(resourceGroupName, vmName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualMachineDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualMachineDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RunCommandDocumentBaseInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunCommandDocumentBaseInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all available run commands for a subscription in a location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunCommandDocumentBaseInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all available run commands for a subscription in a location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RunCommandDocumentBaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList listByVirtualMachineNext(final String nextPageLink) { + ServiceResponse> response = listByVirtualMachineNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByVirtualMachineNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVirtualMachineNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listByVirtualMachineNextAsync(final String nextPageLink) { + return listByVirtualMachineNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listByVirtualMachineNextWithServiceResponseAsync(final String nextPageLink) { + return listByVirtualMachineNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByVirtualMachineNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of a Virtual Machine. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVirtualMachineNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByVirtualMachineNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVirtualMachineNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVirtualMachineNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionImpl.java new file mode 100644 index 000000000000..21ec5545d4aa --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionImpl.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtension; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensionUpdate; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionInstanceView; +import rx.functions.Func1; + +class VirtualMachineScaleSetVMExtensionImpl extends CreatableUpdatableImpl implements VirtualMachineScaleSetVMExtension, VirtualMachineScaleSetVMExtension.Definition, VirtualMachineScaleSetVMExtension.Update { + private final ComputeManager manager; + private String resourceGroupName; + private String vmScaleSetName; + private String instanceId; + private String vmExtensionName; + private VirtualMachineScaleSetVMExtensionUpdate updateParameter; + + VirtualMachineScaleSetVMExtensionImpl(String name, ComputeManager manager) { + super(name, new VirtualMachineScaleSetVMExtensionInner()); + this.manager = manager; + // Set resource name + this.vmExtensionName = name; + // + this.updateParameter = new VirtualMachineScaleSetVMExtensionUpdate(); + } + + VirtualMachineScaleSetVMExtensionImpl(VirtualMachineScaleSetVMExtensionInner inner, ComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.vmExtensionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.vmScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.instanceId = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.vmExtensionName = IdParsingUtils.getValueFromIdByName(inner.id(), "extensions"); + // + this.updateParameter = new VirtualMachineScaleSetVMExtensionUpdate(); + } + + @Override + public ComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualMachineScaleSetVMExtensionsInner client = this.manager().inner().virtualMachineScaleSetVMExtensions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.vmExtensionName, this.inner()) + .map(new Func1() { + @Override + public VirtualMachineScaleSetVMExtensionInner call(VirtualMachineScaleSetVMExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualMachineScaleSetVMExtensionsInner client = this.manager().inner().virtualMachineScaleSetVMExtensions(); + return client.updateAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.vmExtensionName, this.updateParameter) + .map(new Func1() { + @Override + public VirtualMachineScaleSetVMExtensionInner call(VirtualMachineScaleSetVMExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualMachineScaleSetVMExtensionsInner client = this.manager().inner().virtualMachineScaleSetVMExtensions(); + return client.getAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.vmExtensionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VirtualMachineScaleSetVMExtensionUpdate(); + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public Boolean enableAutomaticUpgrade() { + return this.inner().enableAutomaticUpgrade(); + } + + @Override + public String forceUpdateTag() { + return this.inner().forceUpdateTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public VirtualMachineExtensionInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object protectedSettings() { + return this.inner().protectedSettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publisher() { + return this.inner().publisher(); + } + + @Override + public Object settings() { + return this.inner().settings(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String type1() { + return this.inner().type1(); + } + + @Override + public String typeHandlerVersion() { + return this.inner().typeHandlerVersion(); + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withExistingVirtualmachine(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.resourceGroupName = resourceGroupName; + this.vmScaleSetName = vmScaleSetName; + this.instanceId = instanceId; + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.inner().withInstanceView(instanceView); + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.inner().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } else { + this.updateParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.inner().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + } else { + this.updateParameter.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.inner().withForceUpdateTag(forceUpdateTag); + } else { + this.updateParameter.withForceUpdateTag(forceUpdateTag); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.inner().withProtectedSettings(protectedSettings); + } else { + this.updateParameter.withProtectedSettings(protectedSettings); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.inner().withPublisher(publisher); + } else { + this.updateParameter.withPublisher(publisher); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.inner().withSettings(settings); + } else { + this.updateParameter.withSettings(settings); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withType1(String type1) { + if (isInCreateMode()) { + this.inner().withType1(type1); + } else { + this.updateParameter.withType1(type1); + } + return this; + } + + @Override + public VirtualMachineScaleSetVMExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.inner().withTypeHandlerVersion(typeHandlerVersion); + } else { + this.updateParameter.withTypeHandlerVersion(typeHandlerVersion); + } + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionInner.java new file mode 100644 index 000000000000..c7f95792b1ed --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionInner.java @@ -0,0 +1,307 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.compute.v2020_06_01.SubResourceReadOnly; + +/** + * Describes a VMSS VM Extension. + */ +@JsonFlatten +public class VirtualMachineScaleSetVMExtensionInner extends SubResourceReadOnly { + /** + * The name of the extension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String type1; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "properties.enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The virtual machine extension instance view. + */ + @JsonProperty(value = "properties.instanceView") + private VirtualMachineExtensionInstanceView instanceView; + + /** + * Get the name of the extension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type1 value + */ + public String type1() { + return this.type1; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type1 the type1 value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withType1(String type1) { + this.type1 = type1; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtual machine extension instance view. + * + * @return the instanceView value + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the virtual machine extension instance view. + * + * @param instanceView the instanceView value to set + * @return the VirtualMachineScaleSetVMExtensionInner object itself. + */ + public VirtualMachineScaleSetVMExtensionInner withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsImpl.java index a68fa6745a91..c8780da3d6bd 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsImpl.java @@ -14,8 +14,8 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionsListResult; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVirtualMachineExtension; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensionsListResult; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtension; class VirtualMachineScaleSetVMExtensionsImpl extends WrapperImpl implements VirtualMachineScaleSetVMExtensions { private final ComputeManager manager; @@ -30,41 +30,41 @@ public ComputeManager manager() { } @Override - public VirtualMachineScaleSetVirtualMachineExtensionImpl define(String name) { + public VirtualMachineScaleSetVMExtensionImpl define(String name) { return wrapModel(name); } - private VirtualMachineScaleSetVirtualMachineExtensionImpl wrapModel(VirtualMachineExtensionInner inner) { - return new VirtualMachineScaleSetVirtualMachineExtensionImpl(inner, manager()); + private VirtualMachineScaleSetVMExtensionImpl wrapModel(VirtualMachineScaleSetVMExtensionInner inner) { + return new VirtualMachineScaleSetVMExtensionImpl(inner, manager()); } - private VirtualMachineScaleSetVirtualMachineExtensionImpl wrapModel(String name) { - return new VirtualMachineScaleSetVirtualMachineExtensionImpl(name, this.manager()); + private VirtualMachineScaleSetVMExtensionImpl wrapModel(String name) { + return new VirtualMachineScaleSetVMExtensionImpl(name, this.manager()); } @Override - public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { VirtualMachineScaleSetVMExtensionsInner client = this.inner(); return client.listAsync(resourceGroupName, vmScaleSetName, instanceId) - .map(new Func1() { + .map(new Func1() { @Override - public VirtualMachineExtensionsListResult call(VirtualMachineExtensionsListResultInner inner) { - return new VirtualMachineExtensionsListResultImpl(inner, manager()); + public VirtualMachineScaleSetVMExtensionsListResult call(VirtualMachineScaleSetVMExtensionsListResultInner inner) { + return new VirtualMachineScaleSetVMExtensionsListResultImpl(inner, manager()); } }); } @Override - public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { VirtualMachineScaleSetVMExtensionsInner client = this.inner(); return client.getAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) - .flatMap(new Func1>() { + .flatMap(new Func1>() { @Override - public Observable call(VirtualMachineExtensionInner inner) { + public Observable call(VirtualMachineScaleSetVMExtensionInner inner) { if (inner == null) { return Observable.empty(); } else { - return Observable.just((VirtualMachineScaleSetVirtualMachineExtension)wrapModel(inner)); + return Observable.just((VirtualMachineScaleSetVMExtension)wrapModel(inner)); } } }); diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsInner.java index 4225e538ce6e..6aff21d6a011 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsInner.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsInner.java @@ -11,7 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtensionUpdate; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensionUpdate; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -59,19 +59,19 @@ public VirtualMachineScaleSetVMExtensionsInner(Retrofit retrofit, ComputeManagem interface VirtualMachineScaleSetVMExtensionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensions createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineExtensionInner extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMExtensionInner extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensions beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineExtensionInner extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMExtensionInner extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensions update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineExtensionUpdate extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMExtensionUpdate extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensions beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineExtensionUpdate extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMExtensionUpdate extensionParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensions delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", method = "DELETE", hasBody = true) @@ -102,9 +102,9 @@ interface VirtualMachineScaleSetVMExtensionsService { * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionInner object if successful. */ - public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public VirtualMachineScaleSetVMExtensionInner createOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).toBlocking().last().body(); } @@ -120,7 +120,7 @@ public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters), serviceCallback); } @@ -135,10 +135,10 @@ public ServiceFuture createOrUpdateAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -155,7 +155,7 @@ public VirtualMachineExtensionInner call(ServiceResponse> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -177,7 +177,7 @@ public Observable> createOrUpdateW Validator.validate(extensionParameters); final String apiVersion = "2020-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -191,9 +191,9 @@ public Observable> createOrUpdateW * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionInner object if successful. */ - public VirtualMachineExtensionInner beginCreateOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public VirtualMachineScaleSetVMExtensionInner beginCreateOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).toBlocking().single().body(); } @@ -209,7 +209,7 @@ public VirtualMachineExtensionInner beginCreateOrUpdate(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters), serviceCallback); } @@ -222,12 +222,12 @@ public ServiceFuture beginCreateOrUpdateAsync(Stri * @param vmExtensionName The name of the virtual machine extension. * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -242,9 +242,9 @@ public VirtualMachineExtensionInner call(ServiceResponse> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionInner extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -266,11 +266,11 @@ public Observable> beginCreateOrUp Validator.validate(extensionParameters); final String apiVersion = "2020-06-01"; return service.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -279,10 +279,10 @@ public Observable> call(Response beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -298,9 +298,9 @@ private ServiceResponse beginCreateOrUpdateDelegat * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionInner object if successful. */ - public VirtualMachineExtensionInner update(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + public VirtualMachineScaleSetVMExtensionInner update(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).toBlocking().last().body(); } @@ -316,7 +316,7 @@ public VirtualMachineExtensionInner update(String resourceGroupName, String vmSc * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters), serviceCallback); } @@ -331,10 +331,10 @@ public ServiceFuture updateAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + public Observable updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -351,7 +351,7 @@ public VirtualMachineExtensionInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -373,7 +373,7 @@ public Observable> updateWithServi Validator.validate(extensionParameters); final String apiVersion = "2020-06-01"; Observable> observable = service.update(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -387,9 +387,9 @@ public Observable> updateWithServi * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionInner object if successful. */ - public VirtualMachineExtensionInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + public VirtualMachineScaleSetVMExtensionInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).toBlocking().single().body(); } @@ -405,7 +405,7 @@ public VirtualMachineExtensionInner beginUpdate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters), serviceCallback); } @@ -418,12 +418,12 @@ public ServiceFuture beginUpdateAsync(String resou * @param vmExtensionName The name of the virtual machine extension. * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -438,9 +438,9 @@ public VirtualMachineExtensionInner call(ServiceResponse> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -462,11 +462,11 @@ public Observable> beginUpdateWith Validator.validate(extensionParameters); final String apiVersion = "2020-06-01"; return service.beginUpdate(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateDelegate(response); + ServiceResponse clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -475,9 +475,9 @@ public Observable> call(Response beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -671,9 +671,9 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionInner object if successful. */ - public VirtualMachineExtensionInner get(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + public VirtualMachineScaleSetVMExtensionInner get(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).toBlocking().single().body(); } @@ -688,7 +688,7 @@ public VirtualMachineExtensionInner get(String resourceGroupName, String vmScale * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, final ServiceCallback serviceCallback) { + public ServiceFuture getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName), serviceCallback); } @@ -700,12 +700,12 @@ public ServiceFuture getAsync(String resourceGroup * @param instanceId The instance ID of the virtual machine. * @param vmExtensionName The name of the virtual machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionInner object */ - public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).map(new Func1, VirtualMachineExtensionInner>() { + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -719,9 +719,9 @@ public VirtualMachineExtensionInner call(ServiceResponse> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -740,11 +740,11 @@ public Observable> getWithServiceR final String apiVersion = "2020-06-01"; final String expand = null; return service.get(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -764,9 +764,9 @@ public Observable> call(Response getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand, final ServiceCallback serviceCallback) { + public ServiceFuture getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand), serviceCallback); } @@ -795,12 +795,12 @@ public ServiceFuture getAsync(String resourceGroup * @param vmExtensionName The name of the virtual machine extension. * @param expand The expand expression to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionInner object */ - public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { - return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).map(new Func1, VirtualMachineExtensionInner>() { + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).map(new Func1, VirtualMachineScaleSetVMExtensionInner>() { @Override - public VirtualMachineExtensionInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionInner call(ServiceResponse response) { return response.body(); } }); @@ -815,9 +815,9 @@ public VirtualMachineExtensionInner call(ServiceResponse> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -835,11 +835,11 @@ public Observable> getWithServiceR } final String apiVersion = "2020-06-01"; return service.get(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -848,9 +848,9 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -864,9 +864,9 @@ private ServiceResponse getDelegate(Response listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -891,12 +891,12 @@ public ServiceFuture listAsync(String r * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionsListResultInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionsListResultInner object */ - public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, VirtualMachineExtensionsListResultInner>() { + public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, VirtualMachineScaleSetVMExtensionsListResultInner>() { @Override - public VirtualMachineExtensionsListResultInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionsListResultInner call(ServiceResponse response) { return response.body(); } }); @@ -909,9 +909,9 @@ public VirtualMachineExtensionsListResultInner call(ServiceResponse> listWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> listWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -927,11 +927,11 @@ public Observable> list final String apiVersion = "2020-06-01"; final String expand = null; return service.list(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = listDelegate(response); + ServiceResponse clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -950,9 +950,9 @@ public Observable> call * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the VirtualMachineExtensionsListResultInner object if successful. + * @return the VirtualMachineScaleSetVMExtensionsListResultInner object if successful. */ - public VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + public VirtualMachineScaleSetVMExtensionsListResultInner list(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand).toBlocking().single().body(); } @@ -967,7 +967,7 @@ public VirtualMachineExtensionsListResultInner list(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand, final ServiceCallback serviceCallback) { + public ServiceFuture listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand), serviceCallback); } @@ -979,12 +979,12 @@ public ServiceFuture listAsync(String r * @param instanceId The instance ID of the virtual machine. * @param expand The expand expression to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the VirtualMachineExtensionsListResultInner object + * @return the observable to the VirtualMachineScaleSetVMExtensionsListResultInner object */ - public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { - return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand).map(new Func1, VirtualMachineExtensionsListResultInner>() { + public Observable listAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand).map(new Func1, VirtualMachineScaleSetVMExtensionsListResultInner>() { @Override - public VirtualMachineExtensionsListResultInner call(ServiceResponse response) { + public VirtualMachineScaleSetVMExtensionsListResultInner call(ServiceResponse response) { return response.body(); } }); @@ -998,9 +998,9 @@ public VirtualMachineExtensionsListResultInner call(ServiceResponse> listWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { + public Observable> listWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1015,11 +1015,11 @@ public Observable> list } final String apiVersion = "2020-06-01"; return service.list(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = listDelegate(response); + ServiceResponse clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1028,9 +1028,9 @@ public Observable> call }); } - private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java new file mode 100644 index 000000000000..9b88419fec77 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMExtensionsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class VirtualMachineScaleSetVMExtensionsListResultImpl extends WrapperImpl implements VirtualMachineScaleSetVMExtensionsListResult { + private final ComputeManager manager; + VirtualMachineScaleSetVMExtensionsListResultImpl(VirtualMachineScaleSetVMExtensionsListResultInner inner, ComputeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ComputeManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultInner.java new file mode 100644 index 000000000000..cb8ac2b51210 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMExtensionsListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List VMSS VM Extension operation response. + */ +public class VirtualMachineScaleSetVMExtensionsListResultInner { + /** + * The list of VMSS VM extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of VMSS VM extensions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of VMSS VM extensions. + * + * @param value the value value to set + * @return the VirtualMachineScaleSetVMExtensionsListResultInner object itself. + */ + public VirtualMachineScaleSetVMExtensionsListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMImpl.java index 3f83cc4a0e3b..60211dadab1c 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMImpl.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMImpl.java @@ -27,7 +27,7 @@ import java.util.List; import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMInstanceView; import java.util.ArrayList; -import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineVirtualMachineExtension; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineExtension; class VirtualMachineScaleSetVMImpl extends CreatableUpdatableImpl implements VirtualMachineScaleSetVM, VirtualMachineScaleSetVM.Update { private final ComputeManager manager; @@ -181,11 +181,11 @@ public String provisioningState() { } @Override - public List resources() { - List lst = new ArrayList(); + public List resources() { + List lst = new ArrayList(); if (this.inner().resources() != null) { for (VirtualMachineExtensionInner inner : this.inner().resources()) { - lst.add( new VirtualMachineVirtualMachineExtensionImpl(inner, manager())); + lst.add( new VirtualMachineExtensionImpl(inner, manager())); } } return lst; diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMInner.java index 229e640c9793..3244a0a22ac2 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMInner.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMInner.java @@ -138,14 +138,16 @@ public class VirtualMachineScaleSetVMInner extends Resource { /** * Specifies that the image or disk that is being used was licensed - * on-premises. This element is only used for images that contain the - * Windows Server operating system. <br><br> Possible values - * are: <br><br> Windows_Client <br><br> - * Windows_Server <br><br> If this element is included in a - * request for an update, the value must match the initial value. This - * value cannot be updated. <br><br> For more information, see - * [Azure Hybrid Use Benefit for Windows - * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * on-premises. <br><br> Possible values for Windows Server + * operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values + * for Linux Server operating system are: <br><br> RHEL_BYOS + * (for RHEL) <br><br> SLES_BYOS (for SUSE) + * <br><br> For more information, see [Azure Hybrid Use Benefit + * for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) * <br><br> Minimum api-version: 2015-06-15. */ @JsonProperty(value = "properties.licenseType") @@ -424,7 +426,7 @@ public String provisioningState() { } /** - * Get specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Get specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @return the licenseType value */ @@ -433,7 +435,7 @@ public String licenseType() { } /** - * Set specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15. + * Set specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. * * @param licenseType the licenseType value to set * @return the VirtualMachineScaleSetVMInner object itself. diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java new file mode 100644 index 000000000000..67d8f0593a32 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVirtualMachineRunCommand; + +class VirtualMachineScaleSetVMRunCommandsImpl extends WrapperImpl implements VirtualMachineScaleSetVMRunCommands { + private final ComputeManager manager; + + VirtualMachineScaleSetVMRunCommandsImpl(ComputeManager manager) { + super(manager.inner().virtualMachineScaleSetVMRunCommands()); + this.manager = manager; + } + + public ComputeManager manager() { + return this.manager; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl define(String name) { + return wrapModel(name); + } + + private VirtualMachineScaleSetVirtualMachineRunCommandImpl wrapModel(VirtualMachineRunCommandInner inner) { + return new VirtualMachineScaleSetVirtualMachineRunCommandImpl(inner, manager()); + } + + private VirtualMachineScaleSetVirtualMachineRunCommandImpl wrapModel(String name) { + return new VirtualMachineScaleSetVirtualMachineRunCommandImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId) { + VirtualMachineScaleSetVMRunCommandsInner client = this.inner(); + return client.listAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSetVirtualMachineRunCommand call(VirtualMachineRunCommandInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + VirtualMachineScaleSetVMRunCommandsInner client = this.inner(); + return client.getAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName) + .flatMap(new Func1>() { + @Override + public Observable call(VirtualMachineRunCommandInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VirtualMachineScaleSetVirtualMachineRunCommand)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + VirtualMachineScaleSetVMRunCommandsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).toCompletable(); + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsInner.java new file mode 100644 index 000000000000..6d891724f392 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMRunCommandsInner.java @@ -0,0 +1,1236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in VirtualMachineScaleSetVMRunCommands. + */ +public class VirtualMachineScaleSetVMRunCommandsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualMachineScaleSetVMRunCommandsService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetVMRunCommandsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualMachineScaleSetVMRunCommandsInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(VirtualMachineScaleSetVMRunCommandsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualMachineScaleSetVMRunCommands to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualMachineScaleSetVMRunCommandsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandInner runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandInner runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandUpdate runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineRunCommandUpdate runCommand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("runCommandName") String runCommandName, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVMRunCommands listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner createOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).toBlocking().last().body(); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner beginCreateOrUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).toBlocking().single().body(); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandInner runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner update(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).toBlocking().last().body(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + Observable> observable = service.update(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).toBlocking().single().body(); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand), serviceCallback); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, runCommand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, VirtualMachineRunCommandUpdate runCommand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (runCommand == null) { + throw new IllegalArgumentException("Parameter runCommand is required and cannot be null."); + } + Validator.validate(runCommand); + final String apiVersion = "2020-06-01"; + return service.beginUpdate(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), runCommand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).toBlocking().last().body(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName), serviceCallback); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + Observable> observable = service.delete(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).toBlocking().single().body(); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName), serviceCallback); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.beginDelete(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner get(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).toBlocking().single().body(); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName), serviceCallback); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + final String expand = null; + return service.get(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineRunCommandInner object if successful. + */ + public VirtualMachineRunCommandInner get(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).toBlocking().single().body(); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand), serviceCallback); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, runCommandName, expand).map(new Func1, VirtualMachineRunCommandInner>() { + @Override + public VirtualMachineRunCommandInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the VMSS VM run command. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param runCommandName The name of the virtual machine run command. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineRunCommandInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, String runCommandName, String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (runCommandName == null) { + throw new IllegalArgumentException("Parameter runCommandName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.get(resourceGroupName, vmScaleSetName, instanceId, runCommandName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String vmScaleSetName, final String instanceId) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId) { + return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId) { + return listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + final String expand = null; + return service.list(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final String expand) { + return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final String expand) { + return listSinglePageAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param vmScaleSetName The name of the VM scale set. + ServiceResponse> * @param instanceId The instance ID of the virtual machine. + ServiceResponse> * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String vmScaleSetName, final String instanceId, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.list(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualMachineRunCommandInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineRunCommandInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The operation to get all run commands of an instance in Virtual Machine Scaleset. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineRunCommandInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVirtualMachineRunCommandImpl.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVirtualMachineRunCommandImpl.java new file mode 100644 index 000000000000..4247b24d5ba8 --- /dev/null +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVirtualMachineRunCommandImpl.java @@ -0,0 +1,295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute.v2020_06_01.implementation; + +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineScaleSetVirtualMachineRunCommand; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandUpdate; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandScriptSource; +import com.microsoft.azure.management.compute.v2020_06_01.RunCommandInputParameter; +import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachineRunCommandInstanceView; +import rx.functions.Func1; + +class VirtualMachineScaleSetVirtualMachineRunCommandImpl extends CreatableUpdatableImpl implements VirtualMachineScaleSetVirtualMachineRunCommand, VirtualMachineScaleSetVirtualMachineRunCommand.Definition, VirtualMachineScaleSetVirtualMachineRunCommand.Update { + private final ComputeManager manager; + private String resourceGroupName; + private String vmScaleSetName; + private String instanceId; + private String runCommandName; + private VirtualMachineRunCommandUpdate updateParameter; + + VirtualMachineScaleSetVirtualMachineRunCommandImpl(String name, ComputeManager manager) { + super(name, new VirtualMachineRunCommandInner()); + this.manager = manager; + // Set resource name + this.runCommandName = name; + // + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + VirtualMachineScaleSetVirtualMachineRunCommandImpl(VirtualMachineRunCommandInner inner, ComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.runCommandName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.vmScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + this.instanceId = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachines"); + this.runCommandName = IdParsingUtils.getValueFromIdByName(inner.id(), "runCommands"); + // + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + @Override + public ComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualMachineScaleSetVMRunCommandsInner client = this.manager().inner().virtualMachineScaleSetVMRunCommands(); + return client.createOrUpdateAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.runCommandName, this.inner()) + .map(new Func1() { + @Override + public VirtualMachineRunCommandInner call(VirtualMachineRunCommandInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualMachineScaleSetVMRunCommandsInner client = this.manager().inner().virtualMachineScaleSetVMRunCommands(); + return client.updateAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.runCommandName, this.updateParameter) + .map(new Func1() { + @Override + public VirtualMachineRunCommandInner call(VirtualMachineRunCommandInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualMachineScaleSetVMRunCommandsInner client = this.manager().inner().virtualMachineScaleSetVMRunCommands(); + return client.getAsync(this.resourceGroupName, this.vmScaleSetName, this.instanceId, this.runCommandName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VirtualMachineRunCommandUpdate(); + } + + @Override + public Boolean asyncExecution() { + return this.inner().asyncExecution(); + } + + @Override + public String errorBlobUri() { + return this.inner().errorBlobUri(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public VirtualMachineRunCommandInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String outputBlobUri() { + return this.inner().outputBlobUri(); + } + + @Override + public List parameters() { + return this.inner().parameters(); + } + + @Override + public List protectedParameters() { + return this.inner().protectedParameters(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String runAsPassword() { + return this.inner().runAsPassword(); + } + + @Override + public String runAsUser() { + return this.inner().runAsUser(); + } + + @Override + public VirtualMachineRunCommandScriptSource source() { + return this.inner().source(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Integer timeoutInSeconds() { + return this.inner().timeoutInSeconds(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withExistingVirtualmachine(String resourceGroupName, String vmScaleSetName, String instanceId) { + this.resourceGroupName = resourceGroupName; + this.vmScaleSetName = vmScaleSetName; + this.instanceId = instanceId; + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withAsyncExecution(Boolean asyncExecution) { + if (isInCreateMode()) { + this.inner().withAsyncExecution(asyncExecution); + } else { + this.updateParameter.withAsyncExecution(asyncExecution); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withErrorBlobUri(String errorBlobUri) { + if (isInCreateMode()) { + this.inner().withErrorBlobUri(errorBlobUri); + } else { + this.updateParameter.withErrorBlobUri(errorBlobUri); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withOutputBlobUri(String outputBlobUri) { + if (isInCreateMode()) { + this.inner().withOutputBlobUri(outputBlobUri); + } else { + this.updateParameter.withOutputBlobUri(outputBlobUri); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withParameters(List parameters) { + if (isInCreateMode()) { + this.inner().withParameters(parameters); + } else { + this.updateParameter.withParameters(parameters); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withProtectedParameters(List protectedParameters) { + if (isInCreateMode()) { + this.inner().withProtectedParameters(protectedParameters); + } else { + this.updateParameter.withProtectedParameters(protectedParameters); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withRunAsPassword(String runAsPassword) { + if (isInCreateMode()) { + this.inner().withRunAsPassword(runAsPassword); + } else { + this.updateParameter.withRunAsPassword(runAsPassword); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withRunAsUser(String runAsUser) { + if (isInCreateMode()) { + this.inner().withRunAsUser(runAsUser); + } else { + this.updateParameter.withRunAsUser(runAsUser); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withSource(VirtualMachineRunCommandScriptSource source) { + if (isInCreateMode()) { + this.inner().withSource(source); + } else { + this.updateParameter.withSource(source); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public VirtualMachineScaleSetVirtualMachineRunCommandImpl withTimeoutInSeconds(Integer timeoutInSeconds) { + if (isInCreateMode()) { + this.inner().withTimeoutInSeconds(timeoutInSeconds); + } else { + this.updateParameter.withTimeoutInSeconds(timeoutInSeconds); + } + return this; + } + +} diff --git a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachinesInner.java b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachinesInner.java index bebd10bd1fc2..ae0518486094 100644 --- a/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachinesInner.java +++ b/sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachinesInner.java @@ -103,11 +103,11 @@ interface VirtualMachinesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", method = "DELETE", hasBody = true) - Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Query("forceDeletion") Boolean forceDeletion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2020_06_01.VirtualMachines getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") @@ -922,7 +922,77 @@ public Observable> deleteWithServiceResponseAsync(String r throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2020-06-01"; - Observable> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + final Boolean forceDeletion = null; + Observable> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String vmName, Boolean forceDeletion) { + deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).toBlocking().last().body(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion), serviceCallback); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + Observable> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -988,7 +1058,88 @@ public Observable> beginDeleteWithServiceResponseAsync(Str throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2020-06-01"; - return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + final Boolean forceDeletion = null; + return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String vmName, Boolean forceDeletion) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).toBlocking().single().body(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion), serviceCallback); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, forceDeletion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param forceDeletion Optional parameter to force delete virtual machines. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, Boolean forceDeletion) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmName == null) { + throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2020-06-01"; + return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), forceDeletion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {