diff --git a/sdk/compute/mgmt-v2019_07_01/pom.xml b/sdk/compute/mgmt-v2019_07_01/pom.xml index feadf451d018..0da70757feb3 100644 --- a/sdk/compute/mgmt-v2019_07_01/pom.xml +++ b/sdk/compute/mgmt-v2019_07_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-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachine.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachine.java index 194b4e3a1c26..7e4a8cd555fc 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachine.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachine.java @@ -158,7 +158,7 @@ public interface VirtualMachine extends HasInner, Indexable /** * The entirety of the VirtualMachine definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithLocation, DefinitionStages.WithCreate { } /** @@ -172,15 +172,15 @@ interface Blank extends WithLocation { } /** - * The stage of the virtualmachine definition allowing to specify resource group. + * 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); } /** diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSet.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSet.java index b6e6e7a52903..3e83ab3fe02e 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSet.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSet.java @@ -9,23 +9,21 @@ package com.microsoft.azure.management.compute.v2019_07_01; import com.microsoft.azure.arm.model.HasInner; -import com.microsoft.azure.arm.resources.models.Resource; -import com.microsoft.azure.arm.resources.models.GroupableResourceCore; -import com.microsoft.azure.arm.resources.models.HasResourceGroup; -import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.management.compute.v2019_07_01.implementation.VirtualMachineScaleSetInner; +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.v2019_07_01.implementation.ComputeManager; +import java.util.Map; import com.microsoft.azure.SubResource; import java.util.List; -import com.microsoft.azure.management.compute.v2019_07_01.implementation.VirtualMachineScaleSetInner; /** * Type representing VirtualMachineScaleSet. */ -public interface VirtualMachineScaleSet extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { +public interface VirtualMachineScaleSet extends HasInner, Indexable, Updatable, HasManager { /** * @return the additionalCapabilities value. */ @@ -41,11 +39,26 @@ public interface VirtualMachineScaleSet extends HasInner tags(); + + /** + * @return the type value. + */ + String type(); + /** * @return the uniqueId value. */ @@ -114,7 +137,7 @@ public interface VirtualMachineScaleSet extends HasInner { + interface Blank extends WithLocation { } /** - * The stage of the VirtualMachineScaleSet definition allowing to specify the resource group. + * The stage of the virtualmachinescaleset definition allowing to specify Location. */ - interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + interface WithLocation { + /** + * Specifies resourceGroupName. + * @param resourceGroupName The name of the resource group + * @return the next definition stage + */ + WithLocation withExistingLocation(String resourceGroupName); + } + + /** + * The stage of the virtualmachinescaleset definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); } /** @@ -265,6 +306,18 @@ interface WithSku { WithCreate withSku(Sku sku); } + /** + * The stage of the virtualmachinescaleset 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 virtualmachinescaleset definition allowing to specify UpgradePolicy. */ @@ -318,13 +371,13 @@ interface WithZones { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdditionalCapabilities, DefinitionStages.WithAutomaticRepairsPolicy, DefinitionStages.WithDoNotRunExtensionsOnOverprovisionedVMs, DefinitionStages.WithIdentity, DefinitionStages.WithOverprovision, DefinitionStages.WithPlan, DefinitionStages.WithPlatformFaultDomainCount, DefinitionStages.WithProximityPlacementGroup, DefinitionStages.WithScaleInPolicy, DefinitionStages.WithSinglePlacementGroup, DefinitionStages.WithSku, DefinitionStages.WithUpgradePolicy, DefinitionStages.WithVirtualMachineProfile, DefinitionStages.WithZoneBalance, DefinitionStages.WithZones { + interface WithCreate extends Creatable, DefinitionStages.WithAdditionalCapabilities, DefinitionStages.WithAutomaticRepairsPolicy, DefinitionStages.WithDoNotRunExtensionsOnOverprovisionedVMs, DefinitionStages.WithIdentity, DefinitionStages.WithOverprovision, DefinitionStages.WithPlan, DefinitionStages.WithPlatformFaultDomainCount, DefinitionStages.WithProximityPlacementGroup, DefinitionStages.WithScaleInPolicy, DefinitionStages.WithSinglePlacementGroup, DefinitionStages.WithSku, DefinitionStages.WithTags, DefinitionStages.WithUpgradePolicy, DefinitionStages.WithVirtualMachineProfile, DefinitionStages.WithZoneBalance, DefinitionStages.WithZones { } } /** * The template for a VirtualMachineScaleSet update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdditionalCapabilities, UpdateStages.WithAutomaticRepairsPolicy, UpdateStages.WithDoNotRunExtensionsOnOverprovisionedVMs, UpdateStages.WithIdentity, UpdateStages.WithOverprovision, UpdateStages.WithPlan, UpdateStages.WithProximityPlacementGroup, UpdateStages.WithScaleInPolicy, UpdateStages.WithSinglePlacementGroup, UpdateStages.WithSku, UpdateStages.WithUpgradePolicy, UpdateStages.WithVirtualMachineProfile { + interface Update extends Appliable, UpdateStages.WithAdditionalCapabilities, UpdateStages.WithAutomaticRepairsPolicy, UpdateStages.WithDoNotRunExtensionsOnOverprovisionedVMs, UpdateStages.WithIdentity, UpdateStages.WithOverprovision, UpdateStages.WithPlan, UpdateStages.WithProximityPlacementGroup, UpdateStages.WithScaleInPolicy, UpdateStages.WithSinglePlacementGroup, UpdateStages.WithSku, UpdateStages.WithTags, UpdateStages.WithUpgradePolicy, UpdateStages.WithVirtualMachineProfile { } /** @@ -451,6 +504,18 @@ interface WithSku { Update withSku(Sku sku); } + /** + * The stage of the virtualmachinescaleset 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 virtualmachinescaleset update allowing to specify UpgradePolicy. */ diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSetVMs.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSetVMs.java index 1a124e46e224..d89d7f7059c9 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSetVMs.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachineScaleSetVMs.java @@ -106,7 +106,7 @@ public interface VirtualMachineScaleSetVMs extends HasInner, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +public interface VirtualMachineScaleSets extends SupportsCreating, HasInner { + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String vmScaleSetName); + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName); + /** * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * @@ -168,6 +183,32 @@ public interface VirtualMachineScaleSets extends SupportsCreating listByResourceGroupAsync(final String resourceGroupName); + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByLocationAsync(final String location); + /** * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachines.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachines.java index fc86cadbf6e3..9ee05fb34df9 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachines.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/VirtualMachines.java @@ -75,7 +75,7 @@ public interface VirtualMachines { Observable instanceViewAsync(String resourceGroupName, String vmName); /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -165,7 +165,7 @@ public interface VirtualMachines { Completable reimageAsync(String resourceGroupName, String vmName); /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManagementClientImpl.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManagementClientImpl.java index c9244faedd1f..5f72e401fc9c 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManagementClientImpl.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManagementClientImpl.java @@ -252,6 +252,19 @@ public VirtualMachinesInner virtualMachines() { return this.virtualMachines; } + /** + * The VirtualMachineScaleSetsInner object to access its operations. + */ + private VirtualMachineScaleSetsInner virtualMachineScaleSets; + + /** + * Gets the VirtualMachineScaleSetsInner object to access its operations. + * @return the VirtualMachineScaleSetsInner object. + */ + public VirtualMachineScaleSetsInner virtualMachineScaleSets() { + return this.virtualMachineScaleSets; + } + /** * The VirtualMachineSizesInner object to access its operations. */ @@ -278,19 +291,6 @@ public ImagesInner images() { return this.images; } - /** - * The VirtualMachineScaleSetsInner object to access its operations. - */ - private VirtualMachineScaleSetsInner virtualMachineScaleSets; - - /** - * Gets the VirtualMachineScaleSetsInner object to access its operations. - * @return the VirtualMachineScaleSetsInner object. - */ - public VirtualMachineScaleSetsInner virtualMachineScaleSets() { - return this.virtualMachineScaleSets; - } - /** * The VirtualMachineScaleSetExtensionsInner object to access its operations. */ @@ -543,9 +543,9 @@ protected void initialize() { this.virtualMachineImages = new VirtualMachineImagesInner(restClient().retrofit(), this); this.usages = new UsagesInner(restClient().retrofit(), this); this.virtualMachines = new VirtualMachinesInner(restClient().retrofit(), this); + this.virtualMachineScaleSets = new VirtualMachineScaleSetsInner(restClient().retrofit(), this); this.virtualMachineSizes = new VirtualMachineSizesInner(restClient().retrofit(), this); this.images = new ImagesInner(restClient().retrofit(), this); - this.virtualMachineScaleSets = new VirtualMachineScaleSetsInner(restClient().retrofit(), this); this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsInner(restClient().retrofit(), this); this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesInner(restClient().retrofit(), this); this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsInner(restClient().retrofit(), this); diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManager.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManager.java index bc37dc1d0978..78e5e04e0ba4 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManager.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/ComputeManager.java @@ -26,9 +26,9 @@ import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineImages; import com.microsoft.azure.management.compute.v2019_07_01.Usages; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachines; +import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSets; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineSizes; import com.microsoft.azure.management.compute.v2019_07_01.Images; -import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSets; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetExtensions; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetRollingUpgrades; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetVMExtensions; @@ -62,9 +62,9 @@ public final class ComputeManager extends ManagerCore 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-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineImpl.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineImpl.java index d11b318816a4..b5cb551cb676 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineImpl.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineImpl.java @@ -248,7 +248,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-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetImpl.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetImpl.java index f152077afff8..ed24144f70d3 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetImpl.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetImpl.java @@ -8,10 +8,11 @@ package com.microsoft.azure.management.compute.v2019_07_01.implementation; -import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSet; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetUpdate; +import java.util.Map; import com.microsoft.azure.SubResource; import com.microsoft.azure.management.compute.v2019_07_01.Sku; import com.microsoft.azure.management.compute.v2019_07_01.Plan; @@ -25,17 +26,42 @@ import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetUpdateVMProfile; import rx.functions.Func1; -class VirtualMachineScaleSetImpl extends GroupableResourceCoreImpl implements VirtualMachineScaleSet, VirtualMachineScaleSet.Definition, VirtualMachineScaleSet.Update { +class VirtualMachineScaleSetImpl extends CreatableUpdatableImpl implements VirtualMachineScaleSet, VirtualMachineScaleSet.Definition, VirtualMachineScaleSet.Update { + private final ComputeManager manager; + private String resourceGroupName; + private String vmScaleSetName; private VirtualMachineScaleSetUpdate updateParameter; - VirtualMachineScaleSetImpl(String name, VirtualMachineScaleSetInner inner, ComputeManager manager) { - super(name, inner, manager); + + VirtualMachineScaleSetImpl(String name, ComputeManager manager) { + super(name, new VirtualMachineScaleSetInner()); + this.manager = manager; + // Set resource name + this.vmScaleSetName = name; + // this.updateParameter = new VirtualMachineScaleSetUpdate(); } + VirtualMachineScaleSetImpl(VirtualMachineScaleSetInner inner, ComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.vmScaleSetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.vmScaleSetName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineScaleSets"); + // + this.updateParameter = new VirtualMachineScaleSetUpdate(); + } + + @Override + public ComputeManager manager() { + return this.manager; + } + @Override public Observable createResourceAsync() { VirtualMachineScaleSetsInner client = this.manager().inner().virtualMachineScaleSets(); - return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + return client.createOrUpdateAsync(this.resourceGroupName, this.vmScaleSetName, this.inner()) .map(new Func1() { @Override public VirtualMachineScaleSetInner call(VirtualMachineScaleSetInner resource) { @@ -49,7 +75,7 @@ public VirtualMachineScaleSetInner call(VirtualMachineScaleSetInner resource) { @Override public Observable updateResourceAsync() { VirtualMachineScaleSetsInner client = this.manager().inner().virtualMachineScaleSets(); - return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + return client.updateAsync(this.resourceGroupName, this.vmScaleSetName, this.updateParameter) .map(new Func1() { @Override public VirtualMachineScaleSetInner call(VirtualMachineScaleSetInner resource) { @@ -63,7 +89,7 @@ public VirtualMachineScaleSetInner call(VirtualMachineScaleSetInner resource) { @Override protected Observable getInnerAsync() { VirtualMachineScaleSetsInner client = this.manager().inner().virtualMachineScaleSets(); - return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return null; // NOP getInnerAsync implementation as get is not supported } @Override @@ -90,11 +116,26 @@ public Boolean doNotRunExtensionsOnOverprovisionedVMs() { return this.inner().doNotRunExtensionsOnOverprovisionedVMs(); } + @Override + public String id() { + return this.inner().id(); + } + @Override public VirtualMachineScaleSetIdentity identity() { return this.inner().identity(); } + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + @Override public Boolean overprovision() { return this.inner().overprovision(); @@ -135,6 +176,16 @@ public Sku sku() { return this.inner().sku(); } + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + @Override public String uniqueId() { return this.inner().uniqueId(); @@ -160,6 +211,18 @@ public List zones() { return this.inner().zones(); } + @Override + public VirtualMachineScaleSetImpl withExistingLocation(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public VirtualMachineScaleSetImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + @Override public VirtualMachineScaleSetImpl withPlatformFaultDomainCount(Integer platformFaultDomainCount) { this.inner().withPlatformFaultDomainCount(platformFaultDomainCount); @@ -290,6 +353,16 @@ public VirtualMachineScaleSetImpl withSku(Sku sku) { return this; } + @Override + public VirtualMachineScaleSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + @Override public VirtualMachineScaleSetImpl withUpgradePolicy(UpgradePolicy upgradePolicy) { if (isInCreateMode()) { diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetVMsInner.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetVMsInner.java index 775c60bddc7a..f1fb1937d7d2 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetVMsInner.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetVMsInner.java @@ -2537,7 +2537,7 @@ private ServiceResponse beginRedeployDelegate(Response respo } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2551,7 +2551,7 @@ public void performMaintenance(String resourceGroupName, String vmScaleSetName, } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2565,7 +2565,7 @@ public ServiceFuture performMaintenanceAsync(String resourceGroupName, Str } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2583,7 +2583,7 @@ public Void call(ServiceResponse response) { } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2610,7 +2610,7 @@ public Observable> performMaintenanceWithServiceResponseAs } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2624,7 +2624,7 @@ public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetN } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2638,7 +2638,7 @@ public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2656,7 +2656,7 @@ public Void call(ServiceResponse response) { } /** - * Performs maintenance on a virtual machine in a VM scale set. + * Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsImpl.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsImpl.java index b463dfa89e71..60fdda8e6637 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsImpl.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsImpl.java @@ -4,132 +4,67 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * def + * */ package com.microsoft.azure.management.compute.v2019_07_01.implementation; -import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSets; -import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSet; import rx.Observable; -import rx.Completable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import com.microsoft.azure.arm.resources.ResourceUtilsCore; -import com.microsoft.azure.arm.utils.RXMapper; import rx.functions.Func1; -import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSet; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetInstanceView; import com.microsoft.azure.management.compute.v2019_07_01.UpgradeOperationHistoricalStatusInfo; import com.microsoft.azure.management.compute.v2019_07_01.RecoveryWalkResponse; import java.util.List; import com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSetSku; -class VirtualMachineScaleSetsImpl extends GroupableResourcesCoreImpl implements VirtualMachineScaleSets { - protected VirtualMachineScaleSetsImpl(ComputeManager manager) { - super(manager.inner().virtualMachineScaleSets(), manager); - } - - @Override - protected Observable getInnerAsync(String resourceGroupName, String name) { - VirtualMachineScaleSetsInner client = this.inner(); - return client.getByResourceGroupAsync(resourceGroupName, name); - } - - @Override - protected Completable deleteInnerAsync(String resourceGroupName, String name) { - VirtualMachineScaleSetsInner client = this.inner(); - return client.deleteAsync(resourceGroupName, name).toCompletable(); - } - - @Override - public Observable deleteByIdsAsync(Collection ids) { - if (ids == null || ids.isEmpty()) { - return Observable.empty(); - } - Collection> observables = new ArrayList<>(); - for (String id : ids) { - final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); - final String name = ResourceUtilsCore.nameFromResourceId(id); - Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); - observables.add(o); - } - return Observable.mergeDelayError(observables); - } +class VirtualMachineScaleSetsImpl extends WrapperImpl implements VirtualMachineScaleSets { + private final ComputeManager manager; - @Override - public Observable deleteByIdsAsync(String...ids) { - return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + VirtualMachineScaleSetsImpl(ComputeManager manager) { + super(manager.inner().virtualMachineScaleSets()); + this.manager = manager; } - @Override - public void deleteByIds(Collection ids) { - if (ids != null && !ids.isEmpty()) { - this.deleteByIdsAsync(ids).toBlocking().last(); - } + public ComputeManager manager() { + return this.manager; } @Override - public void deleteByIds(String...ids) { - this.deleteByIds(new ArrayList(Arrays.asList(ids))); + public VirtualMachineScaleSetImpl define(String name) { + return wrapModel(name); } - @Override - public PagedList listByResourceGroup(String resourceGroupName) { - VirtualMachineScaleSetsInner client = this.inner(); - return this.wrapList(client.listByResourceGroup(resourceGroupName)); + private VirtualMachineScaleSetImpl wrapModel(VirtualMachineScaleSetInner inner) { + return new VirtualMachineScaleSetImpl(inner, manager()); } - @Override - public Observable listByResourceGroupAsync(String resourceGroupName) { - VirtualMachineScaleSetsInner client = this.inner(); - return client.listByResourceGroupAsync(resourceGroupName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public VirtualMachineScaleSet call(VirtualMachineScaleSetInner inner) { - return wrapModel(inner); - } - }); + private VirtualMachineScaleSetImpl wrapModel(String name) { + return new VirtualMachineScaleSetImpl(name, this.manager()); } @Override - public PagedList list() { + public Completable deleteAsync(String resourceGroupName, String vmScaleSetName) { VirtualMachineScaleSetsInner client = this.inner(); - return this.wrapList(client.list()); + return client.deleteAsync(resourceGroupName, vmScaleSetName).toCompletable(); } @Override - public Observable listAsync() { + public Observable getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { VirtualMachineScaleSetsInner client = this.inner(); - return client.listAsync() - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) + return client.getByResourceGroupAsync(resourceGroupName, vmScaleSetName) .map(new Func1() { @Override public VirtualMachineScaleSet call(VirtualMachineScaleSetInner inner) { - return wrapModel(inner); + return new VirtualMachineScaleSetImpl(inner, manager()); } }); } - @Override - public VirtualMachineScaleSetImpl define(String name) { - return wrapModel(name); - } - @Override public Completable deallocateAsync(String resourceGroupName, String vmScaleSetName) { VirtualMachineScaleSetsInner client = this.inner(); @@ -239,13 +174,57 @@ public Completable convertToSinglePlacementGroupAsync(String resourceGroupName, } @Override - protected VirtualMachineScaleSetImpl wrapModel(VirtualMachineScaleSetInner inner) { - return new VirtualMachineScaleSetImpl(inner.name(), inner, manager()); + public Observable listByResourceGroupAsync(final String resourceGroupName) { + VirtualMachineScaleSetsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSet call(VirtualMachineScaleSetInner inner) { + return new VirtualMachineScaleSetImpl(inner, manager()); + } + }); } @Override - protected VirtualMachineScaleSetImpl wrapModel(String name) { - return new VirtualMachineScaleSetImpl(name, new VirtualMachineScaleSetInner(), this.manager()); + public Observable listAsync() { + VirtualMachineScaleSetsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSet call(VirtualMachineScaleSetInner inner) { + return new VirtualMachineScaleSetImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByLocationAsync(final String location) { + VirtualMachineScaleSetsInner client = this.inner(); + return client.listByLocationAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachineScaleSet call(VirtualMachineScaleSetInner inner) { + return wrapModel(inner); + } + }); } private VirtualMachineScaleSetSkuImpl wrapVirtualMachineScaleSetSkuModel(VirtualMachineScaleSetSkuInner inner) { diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsInner.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsInner.java index 8931938c8cfb..bde4a098c426 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsInner.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachineScaleSetsInner.java @@ -71,6 +71,10 @@ public VirtualMachineScaleSetsInner(Retrofit retrofit, ComputeManagementClientIm * used by Retrofit to perform actually REST calls. */ interface VirtualMachineScaleSetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSets listByLocation" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets") + Observable> listByLocation(@Path("location") String location, @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.v2019_07_01.VirtualMachineScaleSets createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}") Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -207,6 +211,10 @@ interface VirtualMachineScaleSetsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup") Observable> convertToSinglePlacementGroup(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VMScaleSetConvertToSinglePlacementGroupInput parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.v2019_07_01.VirtualMachineScaleSets listByLocationNext" }) + @GET + Observable> listByLocationNext(@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.v2019_07_01.VirtualMachineScaleSets listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -225,6 +233,119 @@ interface VirtualMachineScaleSetsService { } + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @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<VirtualMachineScaleSetInner> object if successful. + */ + public PagedList listByLocation(final String location) { + ServiceResponse> response = listByLocationSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByLocationNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @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> listByLocationAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByLocationSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByLocationNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable> listByLocationAsync(final String location) { + return listByLocationWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable>> listByLocationWithServiceResponseAsync(final String location) { + return listByLocationSinglePageAsync(location) + .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(listByLocationNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified location. + * + ServiceResponse> * @param location The location for which VM scale sets under the subscription are queried. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByLocationSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location 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 = "2019-07-01"; + return service.listByLocation(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByLocationDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByLocationDelegate(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); + } + /** * Create or update a VM scale set. * @@ -4467,6 +4588,117 @@ private ServiceResponse convertToSinglePlacementGroupDelegate(Response listByLocationNext(final String nextPageLink) { + ServiceResponse> response = listByLocationNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByLocationNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified 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> listByLocationNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByLocationNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByLocationNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified 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<VirtualMachineScaleSetInner> object + */ + public Observable> listByLocationNextAsync(final String nextPageLink) { + return listByLocationNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified 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<VirtualMachineScaleSetInner> object + */ + public Observable>> listByLocationNextWithServiceResponseAsync(final String nextPageLink) { + return listByLocationNextSinglePageAsync(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(listByLocationNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the VM scale sets under the specified subscription for the specified 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<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByLocationNextSinglePageAsync(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.listByLocationNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByLocationNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByLocationNextDelegate(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); + } + /** * Gets a list of all VM scale sets under a resource group. * diff --git a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachinesInner.java b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachinesInner.java index 70cbefb22714..e99d6824909a 100644 --- a/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachinesInner.java +++ b/sdk/compute/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/compute/v2019_07_01/implementation/VirtualMachinesInner.java @@ -1246,7 +1246,7 @@ private ServiceResponse instanceViewDelegate(Re } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1259,7 +1259,7 @@ public void convertToManagedDisks(String resourceGroupName, String vmName) { } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1272,7 +1272,7 @@ public ServiceFuture convertToManagedDisksAsync(String resourceGroupName, } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1289,7 +1289,7 @@ public Void call(ServiceResponse response) { } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1312,7 +1312,7 @@ public Observable> convertToManagedDisksWithServiceRespons } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1325,7 +1325,7 @@ public void beginConvertToManagedDisks(String resourceGroupName, String vmName) } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1338,7 +1338,7 @@ public ServiceFuture beginConvertToManagedDisksAsync(String resourceGroupN } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1355,7 +1355,7 @@ public Void call(ServiceResponse response) { } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. <br>For Windows, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).<br>For Linux, please refer to [Convert a virtual machine from unmanaged disks to managed disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3256,7 +3256,7 @@ private ServiceResponse beginReimageDelegate(Response respon } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3269,7 +3269,7 @@ public void performMaintenance(String resourceGroupName, String vmName) { } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3282,7 +3282,7 @@ public ServiceFuture performMaintenanceAsync(String resourceGroupName, Str } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3299,7 +3299,7 @@ public Void call(ServiceResponse response) { } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3322,7 +3322,7 @@ public Observable> performMaintenanceWithServiceResponseAs } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3335,7 +3335,7 @@ public void beginPerformMaintenance(String resourceGroupName, String vmName) { } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3348,7 +3348,7 @@ public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -3365,7 +3365,7 @@ public Void call(ServiceResponse response) { } /** - * The operation to perform maintenance on a virtual machine. + * Shuts down the virtual machine, moves it to an already updated node, and powers it back on during the self-service phase of planned maintenance. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine.