diff --git a/.gitignore b/.gitignore index cbda4da52ce..90c7b00e159 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ local.properties target .idea *.iml +.factorypath # Mac OS # .DS_Store diff --git a/api-specs.json b/api-specs.json index 9b48e31f36c..0b699888281 100644 --- a/api-specs.json +++ b/api-specs.json @@ -76,7 +76,7 @@ "dir": "azure-mgmt-compute", "source": "specification/compute/resource-manager/readme.md", "package": "com.microsoft.azure.management.compute", - "args": "--payload-flattening-threshold=1 --tag=package-2018-04" + "args": "--payload-flattening-threshold=1 --tag=package-2018-06-01" }, "consumption": { "dir": "azure-mgmt-consumption", diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AdditionalUnattendContent.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AdditionalUnattendContent.java index dbbc84f0a5f..0f6476f6245 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AdditionalUnattendContent.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AdditionalUnattendContent.java @@ -49,7 +49,7 @@ public class AdditionalUnattendContent { private String content; /** - * Get the passName value. + * Get the pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem'. * * @return the passName value */ @@ -58,7 +58,7 @@ public PassNames passName() { } /** - * Set the passName value. + * Set the pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem'. * * @param passName the passName value to set * @return the AdditionalUnattendContent object itself. @@ -69,7 +69,7 @@ public AdditionalUnattendContent withPassName(PassNames passName) { } /** - * Get the componentName value. + * Get the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'Microsoft-Windows-Shell-Setup'. * * @return the componentName value */ @@ -78,7 +78,7 @@ public ComponentNames componentName() { } /** - * Set the componentName value. + * Set the component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'Microsoft-Windows-Shell-Setup'. * * @param componentName the componentName value to set * @return the AdditionalUnattendContent object itself. @@ -89,7 +89,7 @@ public AdditionalUnattendContent withComponentName(ComponentNames componentName) } /** - * Get the settingName value. + * Get specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands'. * * @return the settingName value */ @@ -98,7 +98,7 @@ public SettingNames settingName() { } /** - * Set the settingName value. + * Set specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands'. * * @param settingName the settingName value to set * @return the AdditionalUnattendContent object itself. @@ -109,7 +109,7 @@ public AdditionalUnattendContent withSettingName(SettingNames settingName) { } /** - * Get the content value. + * Get specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. * * @return the content value */ @@ -118,7 +118,7 @@ public String content() { } /** - * Set the content value. + * Set specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. * * @param content the content value to set * @return the AdditionalUnattendContent object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AggregatedReplicationState.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AggregatedReplicationState.java new file mode 100644 index 00000000000..9ad2d67e47d --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AggregatedReplicationState.java @@ -0,0 +1,47 @@ +/** + * 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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AggregatedReplicationState. + */ +public final class AggregatedReplicationState extends ExpandableStringEnum { + /** Static value Unknown for AggregatedReplicationState. */ + public static final AggregatedReplicationState UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for AggregatedReplicationState. */ + public static final AggregatedReplicationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for AggregatedReplicationState. */ + public static final AggregatedReplicationState COMPLETED = fromString("Completed"); + + /** Static value Failed for AggregatedReplicationState. */ + public static final AggregatedReplicationState FAILED = fromString("Failed"); + + /** + * Creates or finds a AggregatedReplicationState from its string representation. + * @param name a name to look for + * @return the corresponding AggregatedReplicationState + */ + @JsonCreator + public static AggregatedReplicationState fromString(String name) { + return fromString(name, AggregatedReplicationState.class); + } + + /** + * @return known AggregatedReplicationState values + */ + public static Collection values() { + return values(AggregatedReplicationState.class); + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiEntityReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiEntityReference.java index 7a6af6b2503..d7581221f61 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiEntityReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiEntityReference.java @@ -22,7 +22,7 @@ public class ApiEntityReference { private String id; /** - * Get the id value. + * Get the ARM resource id in the form of /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... * * @return the id value */ @@ -31,7 +31,7 @@ public String id() { } /** - * Set the id value. + * Set the ARM resource id in the form of /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... * * @param id the id value to set * @return the ApiEntityReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiError.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiError.java index 82e3f36b349..12ad6bc97db 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiError.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiError.java @@ -46,7 +46,7 @@ public class ApiError { private String message; /** - * Get the details value. + * Get the Api error details. * * @return the details value */ @@ -55,7 +55,7 @@ public List details() { } /** - * Set the details value. + * Set the Api error details. * * @param details the details value to set * @return the ApiError object itself. @@ -66,7 +66,7 @@ public ApiError withDetails(List details) { } /** - * Get the innererror value. + * Get the Api inner error. * * @return the innererror value */ @@ -75,7 +75,7 @@ public InnerError innererror() { } /** - * Set the innererror value. + * Set the Api inner error. * * @param innererror the innererror value to set * @return the ApiError object itself. @@ -86,7 +86,7 @@ public ApiError withInnererror(InnerError innererror) { } /** - * Get the code value. + * Get the error code. * * @return the code value */ @@ -95,7 +95,7 @@ public String code() { } /** - * Set the code value. + * Set the error code. * * @param code the code value to set * @return the ApiError object itself. @@ -106,7 +106,7 @@ public ApiError withCode(String code) { } /** - * Get the target value. + * Get the target of the particular error. * * @return the target value */ @@ -115,7 +115,7 @@ public String target() { } /** - * Set the target value. + * Set the target of the particular error. * * @param target the target value to set * @return the ApiError object itself. @@ -126,7 +126,7 @@ public ApiError withTarget(String target) { } /** - * Get the message value. + * Get the error message. * * @return the message value */ @@ -135,7 +135,7 @@ public String message() { } /** - * Set the message value. + * Set the error message. * * @param message the message value to set * @return the ApiError object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiErrorBase.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiErrorBase.java index f520179483a..73254f94935 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiErrorBase.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ApiErrorBase.java @@ -33,7 +33,7 @@ public class ApiErrorBase { private String message; /** - * Get the code value. + * Get the error code. * * @return the code value */ @@ -42,7 +42,7 @@ public String code() { } /** - * Set the code value. + * Set the error code. * * @param code the code value to set * @return the ApiErrorBase object itself. @@ -53,7 +53,7 @@ public ApiErrorBase withCode(String code) { } /** - * Get the target value. + * Get the target of the particular error. * * @return the target value */ @@ -62,7 +62,7 @@ public String target() { } /** - * Set the target value. + * Set the target of the particular error. * * @param target the target value to set * @return the ApiErrorBase object itself. @@ -73,7 +73,7 @@ public ApiErrorBase withTarget(String target) { } /** - * Get the message value. + * Get the error message. * * @return the message value */ @@ -82,7 +82,7 @@ public String message() { } /** - * Set the message value. + * Set the error message. * * @param message the message value to set * @return the ApiErrorBase object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AutoOSUpgradePolicy.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AutoOSUpgradePolicy.java new file mode 100644 index 00000000000..0c36c172fec --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AutoOSUpgradePolicy.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration parameters used for performing automatic OS upgrade. + */ +public class AutoOSUpgradePolicy { + /** + * Whether OS image rollback feature should be disabled. Default value is + * false. + */ + @JsonProperty(value = "disableAutoRollback") + private Boolean disableAutoRollback; + + /** + * Get whether OS image rollback feature should be disabled. Default value is false. + * + * @return the disableAutoRollback value + */ + public Boolean disableAutoRollback() { + return this.disableAutoRollback; + } + + /** + * Set whether OS image rollback feature should be disabled. Default value is false. + * + * @param disableAutoRollback the disableAutoRollback value to set + * @return the AutoOSUpgradePolicy object itself. + */ + public AutoOSUpgradePolicy withDisableAutoRollback(Boolean disableAutoRollback) { + this.disableAutoRollback = disableAutoRollback; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySetUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySetUpdate.java new file mode 100644 index 00000000000..6142c65db0b --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AvailabilitySetUpdate.java @@ -0,0 +1,141 @@ +/** + * 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; + +import java.util.List; +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Specifies information about the availability set that the virtual machine + * should be assigned to. Only tags may be updated. + */ +@JsonFlatten +public class AvailabilitySetUpdate extends UpdateResource { + /** + * Update Domain count. + */ + @JsonProperty(value = "properties.platformUpdateDomainCount") + private Integer platformUpdateDomainCount; + + /** + * Fault Domain count. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /** + * A list of references to all virtual machines in the availability set. + */ + @JsonProperty(value = "properties.virtualMachines") + private List virtualMachines; + + /** + * The resource status information. + */ + @JsonProperty(value = "properties.statuses", access = JsonProperty.Access.WRITE_ONLY) + private List statuses; + + /** + * Sku of the availability set. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get update Domain count. + * + * @return the platformUpdateDomainCount value + */ + public Integer platformUpdateDomainCount() { + return this.platformUpdateDomainCount; + } + + /** + * Set update Domain count. + * + * @param platformUpdateDomainCount the platformUpdateDomainCount value to set + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withPlatformUpdateDomainCount(Integer platformUpdateDomainCount) { + this.platformUpdateDomainCount = platformUpdateDomainCount; + return this; + } + + /** + * Get fault Domain count. + * + * @return the platformFaultDomainCount value + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set fault Domain count. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Get a list of references to all virtual machines in the availability set. + * + * @return the virtualMachines value + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set a list of references to all virtual machines in the availability set. + * + * @param virtualMachines the virtualMachines value to set + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the resource status information. + * + * @return the statuses value + */ + public List statuses() { + return this.statuses; + } + + /** + * Get sku of the availability set. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set sku of the availability set. + * + * @param sku the sku value to set + * @return the AvailabilitySetUpdate object itself. + */ + public AvailabilitySetUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnostics.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnostics.java index 4d3e342dc44..95d7748f131 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnostics.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnostics.java @@ -32,7 +32,7 @@ public class BootDiagnostics { private String storageUri; /** - * Get the enabled value. + * Get whether boot diagnostics should be enabled on the Virtual Machine. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set whether boot diagnostics should be enabled on the Virtual Machine. * * @param enabled the enabled value to set * @return the BootDiagnostics object itself. @@ -52,7 +52,7 @@ public BootDiagnostics withEnabled(Boolean enabled) { } /** - * Get the storageUri value. + * Get uri of the storage account to use for placing the console output and screenshot. * * @return the storageUri value */ @@ -61,7 +61,7 @@ public String storageUri() { } /** - * Set the storageUri value. + * Set uri of the storage account to use for placing the console output and screenshot. * * @param storageUri the storageUri value to set * @return the BootDiagnostics object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnosticsInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnosticsInstanceView.java index 12b4a8832d1..fa33fe4a610 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnosticsInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/BootDiagnosticsInstanceView.java @@ -27,7 +27,7 @@ public class BootDiagnosticsInstanceView { private String serialConsoleLogBlobUri; /** - * Get the consoleScreenshotBlobUri value. + * Get the console screenshot blob URI. * * @return the consoleScreenshotBlobUri value */ @@ -36,7 +36,7 @@ public String consoleScreenshotBlobUri() { } /** - * Set the consoleScreenshotBlobUri value. + * Set the console screenshot blob URI. * * @param consoleScreenshotBlobUri the consoleScreenshotBlobUri value to set * @return the BootDiagnosticsInstanceView object itself. @@ -47,7 +47,7 @@ public BootDiagnosticsInstanceView withConsoleScreenshotBlobUri(String consoleSc } /** - * Get the serialConsoleLogBlobUri value. + * Get the Linux serial console log blob Uri. * * @return the serialConsoleLogBlobUri value */ @@ -56,7 +56,7 @@ public String serialConsoleLogBlobUri() { } /** - * Set the serialConsoleLogBlobUri value. + * Set the Linux serial console log blob Uri. * * @param serialConsoleLogBlobUri the serialConsoleLogBlobUri value to set * @return the BootDiagnosticsInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ComputeLongRunningOperationProperties.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ComputeLongRunningOperationProperties.java deleted file mode 100644 index 70868957486..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ComputeLongRunningOperationProperties.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Compute-specific operation properties, including output. - */ -public class ComputeLongRunningOperationProperties { - /** - * Operation output data (raw JSON). - */ - @JsonProperty(value = "output") - private Object output; - - /** - * Get the output value. - * - * @return the output value - */ - public Object output() { - return this.output; - } - - /** - * Set the output value. - * - * @param output the output value to set - * @return the ComputeLongRunningOperationProperties object itself. - */ - public ComputeLongRunningOperationProperties withOutput(Object output) { - this.output = output; - return this; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/CreationData.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/CreationData.java index 3a4a97be686..5121c009502 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/CreationData.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/CreationData.java @@ -51,7 +51,7 @@ public class CreationData { private String sourceResourceId; /** - * Get the createOption value. + * Get this enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore'. * * @return the createOption value */ @@ -60,7 +60,7 @@ public DiskCreateOption createOption() { } /** - * Set the createOption value. + * Set this enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore'. * * @param createOption the createOption value to set * @return the CreationData object itself. @@ -71,7 +71,7 @@ public CreationData withCreateOption(DiskCreateOption createOption) { } /** - * Get the storageAccountId value. + * Get if createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription. * * @return the storageAccountId value */ @@ -80,7 +80,7 @@ public String storageAccountId() { } /** - * Set the storageAccountId value. + * Set if createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription. * * @param storageAccountId the storageAccountId value to set * @return the CreationData object itself. @@ -91,7 +91,7 @@ public CreationData withStorageAccountId(String storageAccountId) { } /** - * Get the imageReference value. + * Get disk source information. * * @return the imageReference value */ @@ -100,7 +100,7 @@ public ImageDiskReference imageReference() { } /** - * Set the imageReference value. + * Set disk source information. * * @param imageReference the imageReference value to set * @return the CreationData object itself. @@ -111,7 +111,7 @@ public CreationData withImageReference(ImageDiskReference imageReference) { } /** - * Get the sourceUri value. + * Get if createOption is Import, this is the URI of a blob to be imported into a managed disk. * * @return the sourceUri value */ @@ -120,7 +120,7 @@ public String sourceUri() { } /** - * Set the sourceUri value. + * Set if createOption is Import, this is the URI of a blob to be imported into a managed disk. * * @param sourceUri the sourceUri value to set * @return the CreationData object itself. @@ -131,7 +131,7 @@ public CreationData withSourceUri(String sourceUri) { } /** - * Get the sourceResourceId value. + * Get if createOption is Copy, this is the ARM id of the source snapshot or disk. * * @return the sourceResourceId value */ @@ -140,7 +140,7 @@ public String sourceResourceId() { } /** - * Set the sourceResourceId value. + * Set if createOption is Copy, this is the ARM id of the source snapshot or disk. * * @param sourceResourceId the sourceResourceId value to set * @return the CreationData object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDisk.java index f937855d07f..870746b3bdd 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDisk.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.implementation.ManagedDiskParametersInner; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -86,10 +85,10 @@ public class DataDisk { * The managed disk parameters. */ @JsonProperty(value = "managedDisk") - private ManagedDiskParametersInner managedDisk; + private ManagedDiskParameters managedDisk; /** - * Get the lun value. + * Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @return the lun value */ @@ -98,7 +97,7 @@ public int lun() { } /** - * Set the lun value. + * Set specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @param lun the lun value to set * @return the DataDisk object itself. @@ -109,7 +108,7 @@ public DataDisk withLun(int lun) { } /** - * Get the name value. + * Get the disk name. * * @return the name value */ @@ -118,7 +117,7 @@ public String name() { } /** - * Set the name value. + * Set the disk name. * * @param name the name value to set * @return the DataDisk object itself. @@ -129,7 +128,7 @@ public DataDisk withName(String name) { } /** - * Get the vhd value. + * Get the virtual hard disk. * * @return the vhd value */ @@ -138,7 +137,7 @@ public VirtualHardDisk vhd() { } /** - * Set the vhd value. + * Set the virtual hard disk. * * @param vhd the vhd value to set * @return the DataDisk object itself. @@ -149,7 +148,7 @@ public DataDisk withVhd(VirtualHardDisk vhd) { } /** - * Get the image value. + * Get the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. * * @return the image value */ @@ -158,7 +157,7 @@ public VirtualHardDisk image() { } /** - * Set the image value. + * Set the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. * * @param image the image value to set * @return the DataDisk object itself. @@ -169,7 +168,7 @@ public DataDisk withImage(VirtualHardDisk image) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -178,7 +177,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the DataDisk object itself. @@ -189,7 +188,7 @@ public DataDisk withCaching(CachingTypes caching) { } /** - * Get the writeAcceleratorEnabled value. + * Get specifies whether writeAccelerator should be enabled or disabled on the disk. * * @return the writeAcceleratorEnabled value */ @@ -198,7 +197,7 @@ public Boolean writeAcceleratorEnabled() { } /** - * Set the writeAcceleratorEnabled value. + * Set specifies whether writeAccelerator should be enabled or disabled on the disk. * * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set * @return the DataDisk object itself. @@ -209,7 +208,7 @@ public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { } /** - * Get the createOption value. + * Get specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @return the createOption value */ @@ -218,7 +217,7 @@ public DiskCreateOptionTypes createOption() { } /** - * Set the createOption value. + * Set specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @param createOption the createOption value to set * @return the DataDisk object itself. @@ -229,7 +228,7 @@ public DataDisk withCreateOption(DiskCreateOptionTypes createOption) { } /** - * Get the diskSizeGB value. + * Get specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @return the diskSizeGB value */ @@ -238,7 +237,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @param diskSizeGB the diskSizeGB value to set * @return the DataDisk object itself. @@ -249,21 +248,21 @@ public DataDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the managedDisk value. + * Get the managed disk parameters. * * @return the managedDisk value */ - public ManagedDiskParametersInner managedDisk() { + public ManagedDiskParameters managedDisk() { return this.managedDisk; } /** - * Set the managedDisk value. + * Set the managed disk parameters. * * @param managedDisk the managedDisk value to set * @return the DataDisk object itself. */ - public DataDisk withManagedDisk(ManagedDiskParametersInner managedDisk) { + public DataDisk withManagedDisk(ManagedDiskParameters managedDisk) { this.managedDisk = managedDisk; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDiskImage.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDiskImage.java index ed8c3f25a4f..c641de8eb86 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDiskImage.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DataDiskImage.java @@ -23,7 +23,7 @@ public class DataDiskImage { private Integer lun; /** - * Get the lun value. + * Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @return the lun value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiagnosticsProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiagnosticsProfile.java index 30eb09b9f7d..e8695724c71 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiagnosticsProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiagnosticsProfile.java @@ -27,7 +27,7 @@ public class DiagnosticsProfile { private BootDiagnostics bootDiagnostics; /** - * Get the bootDiagnostics value. + * Get boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> For Linux Virtual Machines, you can easily view the output of your console log. <br><br> For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the hypervisor. * * @return the bootDiagnostics value */ @@ -36,7 +36,7 @@ public BootDiagnostics bootDiagnostics() { } /** - * Set the bootDiagnostics value. + * Set boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> For Linux Virtual Machines, you can easily view the output of your console log. <br><br> For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the hypervisor. * * @param bootDiagnostics the bootDiagnostics value to set * @return the DiagnosticsProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Disallowed.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Disallowed.java new file mode 100644 index 00000000000..b0e25e51797 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Disallowed.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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the disallowed disk types. + */ +public class Disallowed { + /** + * A list of disk types. + */ + @JsonProperty(value = "diskTypes") + private List diskTypes; + + /** + * Get a list of disk types. + * + * @return the diskTypes value + */ + public List diskTypes() { + return this.diskTypes; + } + + /** + * Set a list of disk types. + * + * @param diskTypes the diskTypes value to set + * @return the Disallowed object itself. + */ + public Disallowed withDiskTypes(List diskTypes) { + this.diskTypes = diskTypes; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskEncryptionSettings.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskEncryptionSettings.java index 53d96f8141a..569191f7b87 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskEncryptionSettings.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskEncryptionSettings.java @@ -35,7 +35,7 @@ public class DiskEncryptionSettings { private Boolean enabled; /** - * Get the diskEncryptionKey value. + * Get specifies the location of the disk encryption key, which is a Key Vault Secret. * * @return the diskEncryptionKey value */ @@ -44,7 +44,7 @@ public KeyVaultSecretReference diskEncryptionKey() { } /** - * Set the diskEncryptionKey value. + * Set specifies the location of the disk encryption key, which is a Key Vault Secret. * * @param diskEncryptionKey the diskEncryptionKey value to set * @return the DiskEncryptionSettings object itself. @@ -55,7 +55,7 @@ public DiskEncryptionSettings withDiskEncryptionKey(KeyVaultSecretReference disk } /** - * Get the keyEncryptionKey value. + * Get specifies the location of the key encryption key in Key Vault. * * @return the keyEncryptionKey value */ @@ -64,7 +64,7 @@ public KeyVaultKeyReference keyEncryptionKey() { } /** - * Set the keyEncryptionKey value. + * Set specifies the location of the key encryption key in Key Vault. * * @param keyEncryptionKey the keyEncryptionKey value to set * @return the DiskEncryptionSettings object itself. @@ -75,7 +75,7 @@ public DiskEncryptionSettings withKeyEncryptionKey(KeyVaultKeyReference keyEncry } /** - * Get the enabled value. + * Get specifies whether disk encryption should be enabled on the virtual machine. * * @return the enabled value */ @@ -84,7 +84,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set specifies whether disk encryption should be enabled on the virtual machine. * * @param enabled the enabled value to set * @return the DiskEncryptionSettings object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskInstanceView.java index 92474499e72..232089c443c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskInstanceView.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.compute; import java.util.List; + import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -35,7 +36,7 @@ public class DiskInstanceView { private List statuses; /** - * Get the name value. + * Get the disk name. * * @return the name value */ @@ -44,7 +45,7 @@ public String name() { } /** - * Set the name value. + * Set the disk name. * * @param name the name value to set * @return the DiskInstanceView object itself. @@ -55,7 +56,7 @@ public DiskInstanceView withName(String name) { } /** - * Get the encryptionSettings value. + * Get specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15. * * @return the encryptionSettings value */ @@ -64,7 +65,7 @@ public List encryptionSettings() { } /** - * Set the encryptionSettings value. + * Set specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15. * * @param encryptionSettings the encryptionSettings value to set * @return the DiskInstanceView object itself. @@ -75,7 +76,7 @@ public DiskInstanceView withEncryptionSettings(List encr } /** - * Get the statuses value. + * Get the resource status information. * * @return the statuses value */ @@ -84,7 +85,7 @@ public List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the DiskInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskSku.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskSku.java index b42552ed482..cfe673b3a02 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskSku.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskSku.java @@ -27,7 +27,7 @@ public class DiskSku { private String tier; /** - * Get the name value. + * Get the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @return the name value */ @@ -36,7 +36,7 @@ public StorageAccountTypes name() { } /** - * Set the name value. + * Set the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @param name the name value to set * @return the DiskSku object itself. @@ -47,7 +47,7 @@ public DiskSku withName(StorageAccountTypes name) { } /** - * Get the tier value. + * Get the sku tier. * * @return the tier value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskUpdate.java new file mode 100644 index 00000000000..3ce17e168ed --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskUpdate.java @@ -0,0 +1,154 @@ +/** + * 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; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Disk update resource. + */ +@JsonFlatten +public class DiskUpdate { + /** + * the Operating System type. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /** + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the VHD to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /** + * Encryption settings for disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettings") + private EncryptionSettings encryptionSettings; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /** + * Get the Operating System type. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating System type. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the DiskUpdate object itself. + */ + public DiskUpdate withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + * + * @param diskSizeGB the diskSizeGB value to set + * @return the DiskUpdate object itself. + */ + public DiskUpdate withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get encryption settings for disk or snapshot. + * + * @return the encryptionSettings value + */ + public EncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set encryption settings for disk or snapshot. + * + * @param encryptionSettings the encryptionSettings value to set + * @return the DiskUpdate object itself. + */ + public DiskUpdate withEncryptionSettings(EncryptionSettings encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the DiskUpdate object itself. + */ + public DiskUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public DiskSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the DiskUpdate object itself. + */ + public DiskUpdate withSku(DiskSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/EncryptionSettings.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/EncryptionSettings.java index ba38f0a6bd6..513d02f9e6d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/EncryptionSettings.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/EncryptionSettings.java @@ -37,7 +37,7 @@ public class EncryptionSettings { private KeyVaultAndKeyReference keyEncryptionKey; /** - * Get the enabled value. + * Get set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. * * @return the enabled value */ @@ -46,7 +46,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * Set set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. * * @param enabled the enabled value to set * @return the EncryptionSettings object itself. @@ -57,7 +57,7 @@ public EncryptionSettings withEnabled(Boolean enabled) { } /** - * Get the diskEncryptionKey value. + * Get key Vault Secret Url and vault id of the disk encryption key. * * @return the diskEncryptionKey value */ @@ -66,7 +66,7 @@ public KeyVaultAndSecretReference diskEncryptionKey() { } /** - * Set the diskEncryptionKey value. + * Set key Vault Secret Url and vault id of the disk encryption key. * * @param diskEncryptionKey the diskEncryptionKey value to set * @return the EncryptionSettings object itself. @@ -77,7 +77,7 @@ public EncryptionSettings withDiskEncryptionKey(KeyVaultAndSecretReference diskE } /** - * Get the keyEncryptionKey value. + * Get key Vault Key Url and vault id of the key encryption key. * * @return the keyEncryptionKey value */ @@ -86,7 +86,7 @@ public KeyVaultAndKeyReference keyEncryptionKey() { } /** - * Set the keyEncryptionKey value. + * Set key Vault Key Url and vault id of the key encryption key. * * @param keyEncryptionKey the keyEncryptionKey value to set * @return the EncryptionSettings object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactPublishingProfileBase.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactPublishingProfileBase.java new file mode 100644 index 00000000000..1f1c8801222 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactPublishingProfileBase.java @@ -0,0 +1,70 @@ +/** + * 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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the basic gallery artifact publishing profile. + */ +public class GalleryArtifactPublishingProfileBase { + /** + * The regions where the artifact is going to be published. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * The source property. + */ + @JsonProperty(value = "source") + private GalleryArtifactSource source; + + /** + * Get the regions where the artifact is going to be published. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions where the artifact is going to be published. + * + * @param regions the regions value to set + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the source value. + * + * @return the source value + */ + public GalleryArtifactSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase withSource(GalleryArtifactSource source) { + this.source = source; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactSource.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactSource.java new file mode 100644 index 00000000000..90c90ea5647 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryArtifactSource.java @@ -0,0 +1,43 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The source of the gallery artifact. + */ +public class GalleryArtifactSource { + /** + * The managedImage property. + */ + @JsonProperty(value = "managedImage") + private ManagedArtifact managedImage; + + /** + * Get the managedImage value. + * + * @return the managedImage value + */ + public ManagedArtifact managedImage() { + return this.managedImage; + } + + /** + * Set the managedImage value. + * + * @param managedImage the managedImage value to set + * @return the GalleryArtifactSource object itself. + */ + public GalleryArtifactSource withManagedImage(ManagedArtifact managedImage) { + this.managedImage = managedImage; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDataDiskImage.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDataDiskImage.java new file mode 100644 index 00000000000..94cb9bbefa6 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDataDiskImage.java @@ -0,0 +1,34 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the data disk image. + */ +public class GalleryDataDiskImage extends GalleryDiskImage { + /** + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /** + * Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value + */ + public Integer lun() { + return this.lun; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDiskImage.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDiskImage.java new file mode 100644 index 00000000000..a62caf3aa5e --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryDiskImage.java @@ -0,0 +1,48 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the disk image base class. + */ +public class GalleryDiskImage { + /** + * It indicates the size of the VHD to create. + */ + @JsonProperty(value = "sizeInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer sizeInGB; + + /** + * The host caching of the disk. Valid values are 'None', 'ReadOnly', and + * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + */ + @JsonProperty(value = "hostCaching", access = JsonProperty.Access.WRITE_ONLY) + private HostCaching hostCaching; + + /** + * Get it indicates the size of the VHD to create. + * + * @return the sizeInGB value + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Get the host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + * + * @return the hostCaching value + */ + public HostCaching hostCaching() { + return this.hostCaching; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryIdentifier.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryIdentifier.java new file mode 100644 index 00000000000..77fc07f2d5f --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryIdentifier.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the gallery unique name. + */ +public class GalleryIdentifier { + /** + * The unique name of the gallery. + */ + @JsonProperty(value = "uniqueName", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueName; + + /** + * Get the unique name of the gallery. + * + * @return the uniqueName value + */ + public String uniqueName() { + return this.uniqueName; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageIdentifier.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageIdentifier.java new file mode 100644 index 00000000000..c971848a1da --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageIdentifier.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the gallery image identifier. + */ +public class GalleryImageIdentifier { + /** + * The gallery image publisher name. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * The gallery image offer name. + */ + @JsonProperty(value = "offer") + private String offer; + + /** + * The gallery image sku name. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * Get the gallery image publisher name. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the gallery image publisher name. + * + * @param publisher the publisher value to set + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the gallery image offer name. + * + * @return the offer value + */ + public String offer() { + return this.offer; + } + + /** + * Set the gallery image offer name. + * + * @param offer the offer value to set + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the gallery image sku name. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set the gallery image sku name. + * + * @param sku the sku value to set + * @return the GalleryImageIdentifier object itself. + */ + public GalleryImageIdentifier withSku(String sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionPublishingProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionPublishingProfile.java new file mode 100644 index 00000000000..2f045fb460e --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionPublishingProfile.java @@ -0,0 +1,113 @@ +/** + * 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; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The publishing profile of a gallery image version. + */ +public class GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /** + * The scale tier of the gallery image version. Valid values are 'S30' and + * 'S100'. Possible values include: 'S30', 'S100'. + */ + @JsonProperty(value = "scaleTier") + private ScaleTier scaleTier; + + /** + * The flag means that if it is set to true, people deploying VMs with + * 'latest' as version will not use this version. + */ + @JsonProperty(value = "excludeFromLatest") + private Boolean excludeFromLatest; + + /** + * The time when the gallery image version is published. + */ + @JsonProperty(value = "publishedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime publishedDate; + + /** + * The end of life date of the gallery image version. + */ + @JsonProperty(value = "endOfLifeDate") + private DateTime endOfLifeDate; + + /** + * Get the scale tier of the gallery image version. Valid values are 'S30' and 'S100'. Possible values include: 'S30', 'S100'. + * + * @return the scaleTier value + */ + public ScaleTier scaleTier() { + return this.scaleTier; + } + + /** + * Set the scale tier of the gallery image version. Valid values are 'S30' and 'S100'. Possible values include: 'S30', 'S100'. + * + * @param scaleTier the scaleTier value to set + * @return the GalleryImageVersionPublishingProfile object itself. + */ + public GalleryImageVersionPublishingProfile withScaleTier(ScaleTier scaleTier) { + this.scaleTier = scaleTier; + return this; + } + + /** + * Get the flag means that if it is set to true, people deploying VMs with 'latest' as version will not use this version. + * + * @return the excludeFromLatest value + */ + public Boolean excludeFromLatest() { + return this.excludeFromLatest; + } + + /** + * Set the flag means that if it is set to true, people deploying VMs with 'latest' as version will not use this version. + * + * @param excludeFromLatest the excludeFromLatest value to set + * @return the GalleryImageVersionPublishingProfile object itself. + */ + public GalleryImageVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { + this.excludeFromLatest = excludeFromLatest; + return this; + } + + /** + * Get the time when the gallery image version is published. + * + * @return the publishedDate value + */ + public DateTime publishedDate() { + return this.publishedDate; + } + + /** + * Get the end of life date of the gallery image version. + * + * @return the endOfLifeDate value + */ + public DateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the end of life date of the gallery image version. + * + * @param endOfLifeDate the endOfLifeDate value to set + * @return the GalleryImageVersionPublishingProfile object itself. + */ + public GalleryImageVersionPublishingProfile withEndOfLifeDate(DateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionStorageProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionStorageProfile.java new file mode 100644 index 00000000000..928732fcb7a --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryImageVersionStorageProfile.java @@ -0,0 +1,48 @@ +/** + * 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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the storage profile of a gallery image version. + */ +public class GalleryImageVersionStorageProfile { + /** + * The osDiskImage property. + */ + @JsonProperty(value = "osDiskImage", access = JsonProperty.Access.WRITE_ONLY) + private GalleryOSDiskImage osDiskImage; + + /** + * A list of data disk images. + */ + @JsonProperty(value = "dataDiskImages", access = JsonProperty.Access.WRITE_ONLY) + private List dataDiskImages; + + /** + * Get the osDiskImage value. + * + * @return the osDiskImage value + */ + public GalleryOSDiskImage osDiskImage() { + return this.osDiskImage; + } + + /** + * Get a list of data disk images. + * + * @return the dataDiskImages value + */ + public List dataDiskImages() { + return this.dataDiskImages; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryOSDiskImage.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryOSDiskImage.java new file mode 100644 index 00000000000..4e2950fb80e --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GalleryOSDiskImage.java @@ -0,0 +1,16 @@ +/** + * 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; + + +/** + * This is the OS disk image. + */ +public class GalleryOSDiskImage extends GalleryDiskImage { +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GrantAccessDataInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GrantAccessData.java similarity index 69% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GrantAccessDataInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GrantAccessData.java index acd97dcb856..6d91f25b9fe 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GrantAccessDataInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/GrantAccessData.java @@ -6,15 +6,14 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.AccessLevel; import com.fasterxml.jackson.annotation.JsonProperty; /** * Data used for requesting a SAS. */ -public class GrantAccessDataInner { +public class GrantAccessData { /** * Possible values include: 'None', 'Read'. */ @@ -28,7 +27,7 @@ public class GrantAccessDataInner { private int durationInSeconds; /** - * Get the access value. + * Get possible values include: 'None', 'Read'. * * @return the access value */ @@ -37,18 +36,18 @@ public AccessLevel access() { } /** - * Set the access value. + * Set possible values include: 'None', 'Read'. * * @param access the access value to set - * @return the GrantAccessDataInner object itself. + * @return the GrantAccessData object itself. */ - public GrantAccessDataInner withAccess(AccessLevel access) { + public GrantAccessData withAccess(AccessLevel access) { this.access = access; return this; } /** - * Get the durationInSeconds value. + * Get time duration in seconds until the SAS access expires. * * @return the durationInSeconds value */ @@ -57,12 +56,12 @@ public int durationInSeconds() { } /** - * Set the durationInSeconds value. + * Set time duration in seconds until the SAS access expires. * * @param durationInSeconds the durationInSeconds value to set - * @return the GrantAccessDataInner object itself. + * @return the GrantAccessData object itself. */ - public GrantAccessDataInner withDurationInSeconds(int durationInSeconds) { + public GrantAccessData withDurationInSeconds(int durationInSeconds) { this.durationInSeconds = durationInSeconds; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HardwareProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HardwareProfile.java index 70ea72443eb..893814739da 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HardwareProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HardwareProfile.java @@ -21,13 +21,14 @@ public class HardwareProfile { * <br><br> The available VM sizes depend on region and * availability set. For a list of available sizes use these APIs: * <br><br> [List all available virtual machine sizes in an - * availability set](virtualmachines-list-sizes-availability-set.md) + * availability + * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) * <br><br> [List all available virtual machine sizes in a - * region](virtualmachines-list-sizes-region.md) <br><br> [List - * all available virtual machine sizes for - * resizing](virtualmachines-list-sizes-for-resizing.md). Possible values - * include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', - * 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + * <br><br> [List all available virtual machine sizes for + * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', * 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', * 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', @@ -78,7 +79,7 @@ public class HardwareProfile { private VirtualMachineSizeTypes vmSize; /** - * Get the vmSize value. + * Get specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24'. * * @return the vmSize value */ @@ -87,7 +88,7 @@ public VirtualMachineSizeTypes vmSize() { } /** - * Set the vmSize value. + * Set specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24'. * * @param vmSize the vmSize value to set * @return the HardwareProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HostCaching.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HostCaching.java new file mode 100644 index 00000000000..50498ff106f --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/HostCaching.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; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HostCaching. + */ +public enum HostCaching { + /** Enum value None. */ + NONE("None"), + + /** Enum value ReadOnly. */ + READ_ONLY("ReadOnly"), + + /** Enum value ReadWrite. */ + READ_WRITE("ReadWrite"); + + /** The actual serialized value for a HostCaching instance. */ + private String value; + + HostCaching(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HostCaching instance. + * + * @param value the serialized value to parse. + * @return the parsed HostCaching object, or null if unable to parse. + */ + @JsonCreator + public static HostCaching fromString(String value) { + HostCaching[] items = HostCaching.values(); + for (HostCaching item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDataDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDataDisk.java index 2aec5e55152..594e7f1259d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDataDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDataDisk.java @@ -68,7 +68,7 @@ public class ImageDataDisk { private StorageAccountTypes storageAccountType; /** - * Get the lun value. + * Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @return the lun value */ @@ -77,7 +77,7 @@ public int lun() { } /** - * Set the lun value. + * Set specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @param lun the lun value to set * @return the ImageDataDisk object itself. @@ -88,7 +88,7 @@ public ImageDataDisk withLun(int lun) { } /** - * Get the snapshot value. + * Get the snapshot. * * @return the snapshot value */ @@ -97,7 +97,7 @@ public SubResource snapshot() { } /** - * Set the snapshot value. + * Set the snapshot. * * @param snapshot the snapshot value to set * @return the ImageDataDisk object itself. @@ -108,7 +108,7 @@ public ImageDataDisk withSnapshot(SubResource snapshot) { } /** - * Get the managedDisk value. + * Get the managedDisk. * * @return the managedDisk value */ @@ -117,7 +117,7 @@ public SubResource managedDisk() { } /** - * Set the managedDisk value. + * Set the managedDisk. * * @param managedDisk the managedDisk value to set * @return the ImageDataDisk object itself. @@ -128,7 +128,7 @@ public ImageDataDisk withManagedDisk(SubResource managedDisk) { } /** - * Get the blobUri value. + * Get the Virtual Hard Disk. * * @return the blobUri value */ @@ -137,7 +137,7 @@ public String blobUri() { } /** - * Set the blobUri value. + * Set the Virtual Hard Disk. * * @param blobUri the blobUri value to set * @return the ImageDataDisk object itself. @@ -148,7 +148,7 @@ public ImageDataDisk withBlobUri(String blobUri) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -157,7 +157,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the ImageDataDisk object itself. @@ -168,7 +168,7 @@ public ImageDataDisk withCaching(CachingTypes caching) { } /** - * Get the diskSizeGB value. + * Get specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @return the diskSizeGB value */ @@ -177,7 +177,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @param diskSizeGB the diskSizeGB value to set * @return the ImageDataDisk object itself. @@ -188,7 +188,7 @@ public ImageDataDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the storageAccountType value. + * Get specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @return the storageAccountType value */ @@ -197,7 +197,7 @@ public StorageAccountTypes storageAccountType() { } /** - * Set the storageAccountType value. + * Set specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @param storageAccountType the storageAccountType value to set * @return the ImageDataDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDiskReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDiskReference.java index c1a048e8a69..22a3269bb74 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDiskReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageDiskReference.java @@ -30,7 +30,7 @@ public class ImageDiskReference { private Integer lun; /** - * Get the id value. + * Get a relative uri containing either a Platform Imgage Repository or user image reference. * * @return the id value */ @@ -39,7 +39,7 @@ public String id() { } /** - * Set the id value. + * Set a relative uri containing either a Platform Imgage Repository or user image reference. * * @param id the id value to set * @return the ImageDiskReference object itself. @@ -50,7 +50,7 @@ public ImageDiskReference withId(String id) { } /** - * Get the lun value. + * Get if the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. * * @return the lun value */ @@ -59,7 +59,7 @@ public Integer lun() { } /** - * Set the lun value. + * Set if the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. * * @param lun the lun value to set * @return the ImageDiskReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageOSDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageOSDisk.java index 03a1c0c59d8..896653c6fb7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageOSDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageOSDisk.java @@ -76,7 +76,7 @@ public class ImageOSDisk { private StorageAccountTypes storageAccountType; /** - * Get the osType value. + * Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -85,7 +85,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the ImageOSDisk object itself. @@ -96,7 +96,7 @@ public ImageOSDisk withOsType(OperatingSystemTypes osType) { } /** - * Get the osState value. + * Get the OS State. Possible values include: 'Generalized', 'Specialized'. * * @return the osState value */ @@ -105,7 +105,7 @@ public OperatingSystemStateTypes osState() { } /** - * Set the osState value. + * Set the OS State. Possible values include: 'Generalized', 'Specialized'. * * @param osState the osState value to set * @return the ImageOSDisk object itself. @@ -116,7 +116,7 @@ public ImageOSDisk withOsState(OperatingSystemStateTypes osState) { } /** - * Get the snapshot value. + * Get the snapshot. * * @return the snapshot value */ @@ -125,7 +125,7 @@ public SubResource snapshot() { } /** - * Set the snapshot value. + * Set the snapshot. * * @param snapshot the snapshot value to set * @return the ImageOSDisk object itself. @@ -136,7 +136,7 @@ public ImageOSDisk withSnapshot(SubResource snapshot) { } /** - * Get the managedDisk value. + * Get the managedDisk. * * @return the managedDisk value */ @@ -145,7 +145,7 @@ public SubResource managedDisk() { } /** - * Set the managedDisk value. + * Set the managedDisk. * * @param managedDisk the managedDisk value to set * @return the ImageOSDisk object itself. @@ -156,7 +156,7 @@ public ImageOSDisk withManagedDisk(SubResource managedDisk) { } /** - * Get the blobUri value. + * Get the Virtual Hard Disk. * * @return the blobUri value */ @@ -165,7 +165,7 @@ public String blobUri() { } /** - * Set the blobUri value. + * Set the Virtual Hard Disk. * * @param blobUri the blobUri value to set * @return the ImageOSDisk object itself. @@ -176,7 +176,7 @@ public ImageOSDisk withBlobUri(String blobUri) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -185,7 +185,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the ImageOSDisk object itself. @@ -196,7 +196,7 @@ public ImageOSDisk withCaching(CachingTypes caching) { } /** - * Get the diskSizeGB value. + * Get specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @return the diskSizeGB value */ @@ -205,7 +205,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @param diskSizeGB the diskSizeGB value to set * @return the ImageOSDisk object itself. @@ -216,7 +216,7 @@ public ImageOSDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the storageAccountType value. + * Get specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @return the storageAccountType value */ @@ -225,7 +225,7 @@ public StorageAccountTypes storageAccountType() { } /** - * Set the storageAccountType value. + * Set specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @param storageAccountType the storageAccountType value to set * @return the ImageOSDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImagePurchasePlan.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImagePurchasePlan.java new file mode 100644 index 00000000000..a2d79d93c73 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImagePurchasePlan.java @@ -0,0 +1,96 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the gallery image purchase plan. This is used by marketplace + * images. + */ +public class ImagePurchasePlan { + /** + * The plan ID. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The publisher ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * The product ID. + */ + @JsonProperty(value = "product") + private String product; + + /** + * Get the plan ID. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the plan ID. + * + * @param name the name value to set + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher ID. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher ID. + * + * @param publisher the publisher value to set + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product ID. + * + * @return the product value + */ + public String product() { + return this.product; + } + + /** + * Set the product ID. + * + * @param product the product value to set + * @return the ImagePurchasePlan object itself. + */ + public ImagePurchasePlan withProduct(String product) { + this.product = product; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageReference.java index a13e7378859..dc40c3ad0f0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageReference.java @@ -2,81 +2,55 @@ * 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; -import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.compute.implementation.ImageReferenceInner; -import com.microsoft.azure.management.resources.fluentcore.model.implementation.WrapperImpl; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.SubResource; /** - * The image reference. + * Specifies information about the image to use. You can specify information + * about platform images, marketplace images, or virtual machine images. This + * element is required when you want to use a platform image, marketplace + * image, or virtual machine image, but is not used in other creation + * operations. */ -@LangDefinition(ContainerName = "/Microsoft.Azure.Management.Compute.Fluent.Models") -public class ImageReference extends WrapperImpl { - private String id; - private String publisher; - private String offer; - private String sku; - private String version; - - +public class ImageReference extends SubResource { /** - * Creates ImageReference. + * The image publisher. */ - public ImageReference() { - super(null); - } + @JsonProperty(value = "publisher") + private String publisher; /** - * Creates ImageReference. - * - * @param inner the inner object + * Specifies the offer of the platform image or marketplace image used to + * create the virtual machine. */ - public ImageReference(ImageReferenceInner inner) { - super(inner); - this.withPublisher(inner.publisher()) - .withOffer(inner.offer()) - .withVersion(inner.version()) - .withSku(inner.sku()) - .withId(inner.id()); - } - - @Override - public ImageReferenceInner inner() { - if (super.inner() != null) { - return super.inner(); - } - ImageReferenceInner imageReferenceInner = new ImageReferenceInner(); - imageReferenceInner - .withPublisher(this.publisher()) - .withOffer(this.offer()) - .withVersion(this.version()) - .withSku(this.sku()) - .withId(this.id()); - return imageReferenceInner; - } + @JsonProperty(value = "offer") + private String offer; /** - * @return the resource ID of the image + * The image SKU. */ - public String id() { - return this.id; - } + @JsonProperty(value = "sku") + private String sku; /** - * Sets the image resource ID value. - * @param id the ID - * @return the ImageReference object itself. + * Specifies the version of the platform image or marketplace image used to + * create the virtual machine. The allowed formats are Major.Minor.Build or + * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' + * to use the latest version of an image available at deploy time. Even if + * you use 'latest', the VM image will not automatically update after + * deploy time even if a new version becomes available. */ - public ImageReference withId(String id) { - this.id = id; - return this; - } + @JsonProperty(value = "version") + private String version; /** - * Get the publisher value. + * Get the image publisher. * * @return the publisher value */ @@ -85,7 +59,7 @@ public String publisher() { } /** - * Set the publisher value. + * Set the image publisher. * * @param publisher the publisher value to set * @return the ImageReference object itself. @@ -96,7 +70,7 @@ public ImageReference withPublisher(String publisher) { } /** - * Get the offer value. + * Get specifies the offer of the platform image or marketplace image used to create the virtual machine. * * @return the offer value */ @@ -105,7 +79,7 @@ public String offer() { } /** - * Set the offer value. + * Set specifies the offer of the platform image or marketplace image used to create the virtual machine. * * @param offer the offer value to set * @return the ImageReference object itself. @@ -116,16 +90,18 @@ public ImageReference withOffer(String offer) { } /** - * @return the SKU + * Get the image SKU. + * + * @return the sku value */ public String sku() { return this.sku; } /** - * Sets the SKU. + * Set the image SKU. * - * @param sku the SKU + * @param sku the sku value to set * @return the ImageReference object itself. */ public ImageReference withSku(String sku) { @@ -134,7 +110,7 @@ public ImageReference withSku(String sku) { } /** - * Get the version value. + * Get specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. * * @return the version value */ @@ -143,7 +119,7 @@ public String version() { } /** - * Set the version value. + * Set specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. * * @param version the version value to set * @return the ImageReference object itself. @@ -153,4 +129,4 @@ public ImageReference withVersion(String version) { return this; } -} \ No newline at end of file +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageStorageProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageStorageProfile.java index d3e87946e78..b6633cb7a84 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageStorageProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageStorageProfile.java @@ -42,7 +42,7 @@ public class ImageStorageProfile { private Boolean zoneResilient; /** - * Get the osDisk value. + * Get specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the osDisk value */ @@ -51,7 +51,7 @@ public ImageOSDisk osDisk() { } /** - * Set the osDisk value. + * Set specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param osDisk the osDisk value to set * @return the ImageStorageProfile object itself. @@ -62,7 +62,7 @@ public ImageStorageProfile withOsDisk(ImageOSDisk osDisk) { } /** - * Get the dataDisks value. + * Get specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the dataDisks value */ @@ -71,7 +71,7 @@ public List dataDisks() { } /** - * Set the dataDisks value. + * Set specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param dataDisks the dataDisks value to set * @return the ImageStorageProfile object itself. @@ -82,7 +82,7 @@ public ImageStorageProfile withDataDisks(List dataDisks) { } /** - * Get the zoneResilient value. + * Get specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). * * @return the zoneResilient value */ @@ -91,7 +91,7 @@ public Boolean zoneResilient() { } /** - * Set the zoneResilient value. + * Set specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). * * @param zoneResilient the zoneResilient value to set * @return the ImageStorageProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageUpdate.java new file mode 100644 index 00000000000..f260a655c52 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ImageUpdate.java @@ -0,0 +1,87 @@ +/** + * 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; + +import com.microsoft.azure.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The source user image virtual hard disk. Only tags may be updated. + */ +@JsonFlatten +public class ImageUpdate extends UpdateResource { + /** + * The source virtual machine from which Image is created. + */ + @JsonProperty(value = "properties.sourceVirtualMachine") + private SubResource sourceVirtualMachine; + + /** + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private ImageStorageProfile storageProfile; + + /** + * The provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the source virtual machine from which Image is created. + * + * @return the sourceVirtualMachine value + */ + public SubResource sourceVirtualMachine() { + return this.sourceVirtualMachine; + } + + /** + * Set the source virtual machine from which Image is created. + * + * @param sourceVirtualMachine the sourceVirtualMachine value to set + * @return the ImageUpdate object itself. + */ + public ImageUpdate withSourceVirtualMachine(SubResource sourceVirtualMachine) { + this.sourceVirtualMachine = sourceVirtualMachine; + return this; + } + + /** + * Get specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value + */ + public ImageStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set + * @return the ImageUpdate object itself. + */ + public ImageUpdate withStorageProfile(ImageStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the provisioning state. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InnerError.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InnerError.java index 87179759633..2c5a8559298 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InnerError.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InnerError.java @@ -27,7 +27,7 @@ public class InnerError { private String errordetail; /** - * Get the exceptiontype value. + * Get the exception type. * * @return the exceptiontype value */ @@ -36,7 +36,7 @@ public String exceptiontype() { } /** - * Set the exceptiontype value. + * Set the exception type. * * @param exceptiontype the exceptiontype value to set * @return the InnerError object itself. @@ -47,7 +47,7 @@ public InnerError withExceptiontype(String exceptiontype) { } /** - * Get the errordetail value. + * Get the internal error message or exception dump. * * @return the errordetail value */ @@ -56,7 +56,7 @@ public String errordetail() { } /** - * Set the errordetail value. + * Set the internal error message or exception dump. * * @param errordetail the errordetail value to set * @return the InnerError object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InstanceViewStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InstanceViewStatus.java index e2b2e9c7638..3d2ab7c9ffd 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InstanceViewStatus.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/InstanceViewStatus.java @@ -46,7 +46,7 @@ public class InstanceViewStatus { private DateTime time; /** - * Get the code value. + * Get the status code. * * @return the code value */ @@ -55,7 +55,7 @@ public String code() { } /** - * Set the code value. + * Set the status code. * * @param code the code value to set * @return the InstanceViewStatus object itself. @@ -66,7 +66,7 @@ public InstanceViewStatus withCode(String code) { } /** - * Get the level value. + * Get the level code. Possible values include: 'Info', 'Warning', 'Error'. * * @return the level value */ @@ -75,7 +75,7 @@ public StatusLevelTypes level() { } /** - * Set the level value. + * Set the level code. Possible values include: 'Info', 'Warning', 'Error'. * * @param level the level value to set * @return the InstanceViewStatus object itself. @@ -86,7 +86,7 @@ public InstanceViewStatus withLevel(StatusLevelTypes level) { } /** - * Get the displayStatus value. + * Get the short localizable label for the status. * * @return the displayStatus value */ @@ -95,7 +95,7 @@ public String displayStatus() { } /** - * Set the displayStatus value. + * Set the short localizable label for the status. * * @param displayStatus the displayStatus value to set * @return the InstanceViewStatus object itself. @@ -106,7 +106,7 @@ public InstanceViewStatus withDisplayStatus(String displayStatus) { } /** - * Get the message value. + * Get the detailed status message, including for alerts and error messages. * * @return the message value */ @@ -115,7 +115,7 @@ public String message() { } /** - * Set the message value. + * Set the detailed status message, including for alerts and error messages. * * @param message the message value to set * @return the InstanceViewStatus object itself. @@ -126,7 +126,7 @@ public InstanceViewStatus withMessage(String message) { } /** - * Get the time value. + * Get the time of the status. * * @return the time value */ @@ -135,7 +135,7 @@ public DateTime time() { } /** - * Set the time value. + * Set the time of the status. * * @param time the time value to set * @return the InstanceViewStatus object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndKeyReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndKeyReference.java index 8554ddff181..f7fc290061e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndKeyReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndKeyReference.java @@ -28,7 +28,7 @@ public class KeyVaultAndKeyReference { private String keyUrl; /** - * Get the sourceVault value. + * Get resource id of the KeyVault containing the key or secret. * * @return the sourceVault value */ @@ -37,7 +37,7 @@ public SourceVault sourceVault() { } /** - * Set the sourceVault value. + * Set resource id of the KeyVault containing the key or secret. * * @param sourceVault the sourceVault value to set * @return the KeyVaultAndKeyReference object itself. @@ -48,7 +48,7 @@ public KeyVaultAndKeyReference withSourceVault(SourceVault sourceVault) { } /** - * Get the keyUrl value. + * Get url pointing to a key or secret in KeyVault. * * @return the keyUrl value */ @@ -57,7 +57,7 @@ public String keyUrl() { } /** - * Set the keyUrl value. + * Set url pointing to a key or secret in KeyVault. * * @param keyUrl the keyUrl value to set * @return the KeyVaultAndKeyReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndSecretReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndSecretReference.java index f7fcde0d42b..d6d701820e8 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndSecretReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultAndSecretReference.java @@ -27,7 +27,7 @@ public class KeyVaultAndSecretReference { private String secretUrl; /** - * Get the sourceVault value. + * Get resource id of the KeyVault containing the key or secret. * * @return the sourceVault value */ @@ -36,7 +36,7 @@ public SourceVault sourceVault() { } /** - * Set the sourceVault value. + * Set resource id of the KeyVault containing the key or secret. * * @param sourceVault the sourceVault value to set * @return the KeyVaultAndSecretReference object itself. @@ -47,7 +47,7 @@ public KeyVaultAndSecretReference withSourceVault(SourceVault sourceVault) { } /** - * Get the secretUrl value. + * Get url pointing to a key or secret in KeyVault. * * @return the secretUrl value */ @@ -56,7 +56,7 @@ public String secretUrl() { } /** - * Set the secretUrl value. + * Set url pointing to a key or secret in KeyVault. * * @param secretUrl the secretUrl value to set * @return the KeyVaultAndSecretReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultKeyReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultKeyReference.java index bcc6c3e78a0..59a4e5a5bb0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultKeyReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultKeyReference.java @@ -28,7 +28,7 @@ public class KeyVaultKeyReference { private SubResource sourceVault; /** - * Get the keyUrl value. + * Get the URL referencing a key encryption key in Key Vault. * * @return the keyUrl value */ @@ -37,7 +37,7 @@ public String keyUrl() { } /** - * Set the keyUrl value. + * Set the URL referencing a key encryption key in Key Vault. * * @param keyUrl the keyUrl value to set * @return the KeyVaultKeyReference object itself. @@ -48,7 +48,7 @@ public KeyVaultKeyReference withKeyUrl(String keyUrl) { } /** - * Get the sourceVault value. + * Get the relative URL of the Key Vault containing the key. * * @return the sourceVault value */ @@ -57,7 +57,7 @@ public SubResource sourceVault() { } /** - * Set the sourceVault value. + * Set the relative URL of the Key Vault containing the key. * * @param sourceVault the sourceVault value to set * @return the KeyVaultKeyReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultSecretReference.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultSecretReference.java index be661cc5788..a53f65c6f13 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultSecretReference.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/KeyVaultSecretReference.java @@ -28,7 +28,7 @@ public class KeyVaultSecretReference { private SubResource sourceVault; /** - * Get the secretUrl value. + * Get the URL referencing a secret in a Key Vault. * * @return the secretUrl value */ @@ -37,7 +37,7 @@ public String secretUrl() { } /** - * Set the secretUrl value. + * Set the URL referencing a secret in a Key Vault. * * @param secretUrl the secretUrl value to set * @return the KeyVaultSecretReference object itself. @@ -48,7 +48,7 @@ public KeyVaultSecretReference withSecretUrl(String secretUrl) { } /** - * Get the sourceVault value. + * Get the relative URL of the Key Vault containing the secret. * * @return the sourceVault value */ @@ -57,7 +57,7 @@ public SubResource sourceVault() { } /** - * Set the sourceVault value. + * Set the relative URL of the Key Vault containing the secret. * * @param sourceVault the sourceVault value to set * @return the KeyVaultSecretReference object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LinuxConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LinuxConfiguration.java index 4437d203c44..7a283529f11 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LinuxConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LinuxConfiguration.java @@ -33,7 +33,17 @@ public class LinuxConfiguration { private SshConfiguration ssh; /** - * Get the disablePasswordAuthentication value. + * Indicates whether virtual machine agent should be provisioned on the + * virtual machine. <br><br> When this property is not + * specified in the request body, default behavior is to set it to true. + * This will ensure that VM Agent is installed on the VM so that extensions + * can be added to the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /** + * Get specifies whether password authentication should be disabled. * * @return the disablePasswordAuthentication value */ @@ -42,7 +52,7 @@ public Boolean disablePasswordAuthentication() { } /** - * Set the disablePasswordAuthentication value. + * Set specifies whether password authentication should be disabled. * * @param disablePasswordAuthentication the disablePasswordAuthentication value to set * @return the LinuxConfiguration object itself. @@ -53,7 +63,7 @@ public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePassw } /** - * Get the ssh value. + * Get specifies the ssh key configuration for a Linux OS. * * @return the ssh value */ @@ -62,7 +72,7 @@ public SshConfiguration ssh() { } /** - * Set the ssh value. + * Set specifies the ssh key configuration for a Linux OS. * * @param ssh the ssh value to set * @return the LinuxConfiguration object itself. @@ -72,4 +82,24 @@ public LinuxConfiguration withSsh(SshConfiguration ssh) { return this; } + /** + * Get indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @return the provisionVMAgent value + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @param provisionVMAgent the provisionVMAgent value to set + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java index ea7bb1f06a3..c30c957ead2 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java @@ -53,7 +53,7 @@ public class LogAnalyticsInputBase { private Boolean groupByResourceName; /** - * Get the blobContainerSasUri value. + * Get sAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. * * @return the blobContainerSasUri value */ @@ -62,7 +62,7 @@ public String blobContainerSasUri() { } /** - * Set the blobContainerSasUri value. + * Set sAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. * * @param blobContainerSasUri the blobContainerSasUri value to set * @return the LogAnalyticsInputBase object itself. @@ -73,7 +73,7 @@ public LogAnalyticsInputBase withBlobContainerSasUri(String blobContainerSasUri) } /** - * Get the fromTime value. + * Get from time of the query. * * @return the fromTime value */ @@ -82,7 +82,7 @@ public DateTime fromTime() { } /** - * Set the fromTime value. + * Set from time of the query. * * @param fromTime the fromTime value to set * @return the LogAnalyticsInputBase object itself. @@ -93,7 +93,7 @@ public LogAnalyticsInputBase withFromTime(DateTime fromTime) { } /** - * Get the toTime value. + * Get to time of the query. * * @return the toTime value */ @@ -102,7 +102,7 @@ public DateTime toTime() { } /** - * Set the toTime value. + * Set to time of the query. * * @param toTime the toTime value to set * @return the LogAnalyticsInputBase object itself. @@ -113,7 +113,7 @@ public LogAnalyticsInputBase withToTime(DateTime toTime) { } /** - * Get the groupByThrottlePolicy value. + * Get group query result by Throttle Policy applied. * * @return the groupByThrottlePolicy value */ @@ -122,7 +122,7 @@ public Boolean groupByThrottlePolicy() { } /** - * Set the groupByThrottlePolicy value. + * Set group query result by Throttle Policy applied. * * @param groupByThrottlePolicy the groupByThrottlePolicy value to set * @return the LogAnalyticsInputBase object itself. @@ -133,7 +133,7 @@ public LogAnalyticsInputBase withGroupByThrottlePolicy(Boolean groupByThrottlePo } /** - * Get the groupByOperationName value. + * Get group query result by by Operation Name. * * @return the groupByOperationName value */ @@ -142,7 +142,7 @@ public Boolean groupByOperationName() { } /** - * Set the groupByOperationName value. + * Set group query result by by Operation Name. * * @param groupByOperationName the groupByOperationName value to set * @return the LogAnalyticsInputBase object itself. @@ -153,7 +153,7 @@ public LogAnalyticsInputBase withGroupByOperationName(Boolean groupByOperationNa } /** - * Get the groupByResourceName value. + * Get group query result by Resource Name. * * @return the groupByResourceName value */ @@ -162,7 +162,7 @@ public Boolean groupByResourceName() { } /** - * Set the groupByResourceName value. + * Set group query result by Resource Name. * * @param groupByResourceName the groupByResourceName value to set * @return the LogAnalyticsInputBase object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsOutput.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsOutput.java index e7cc3767cd5..dc310a855cb 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsOutput.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsOutput.java @@ -21,7 +21,7 @@ public class LogAnalyticsOutput { private String output; /** - * Get the output value. + * Get output file Uri path to blob container. * * @return the output value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/MaintenanceRedeployStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/MaintenanceRedeployStatus.java index 291b72fa5df..33444244cb2 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/MaintenanceRedeployStatus.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/MaintenanceRedeployStatus.java @@ -59,7 +59,7 @@ public class MaintenanceRedeployStatus { private String lastOperationMessage; /** - * Get the isCustomerInitiatedMaintenanceAllowed value. + * Get true, if customer is allowed to perform Maintenance. * * @return the isCustomerInitiatedMaintenanceAllowed value */ @@ -68,7 +68,7 @@ public Boolean isCustomerInitiatedMaintenanceAllowed() { } /** - * Set the isCustomerInitiatedMaintenanceAllowed value. + * Set true, if customer is allowed to perform Maintenance. * * @param isCustomerInitiatedMaintenanceAllowed the isCustomerInitiatedMaintenanceAllowed value to set * @return the MaintenanceRedeployStatus object itself. @@ -79,7 +79,7 @@ public MaintenanceRedeployStatus withIsCustomerInitiatedMaintenanceAllowed(Boole } /** - * Get the preMaintenanceWindowStartTime value. + * Get start Time for the Pre Maintenance Window. * * @return the preMaintenanceWindowStartTime value */ @@ -88,7 +88,7 @@ public DateTime preMaintenanceWindowStartTime() { } /** - * Set the preMaintenanceWindowStartTime value. + * Set start Time for the Pre Maintenance Window. * * @param preMaintenanceWindowStartTime the preMaintenanceWindowStartTime value to set * @return the MaintenanceRedeployStatus object itself. @@ -99,7 +99,7 @@ public MaintenanceRedeployStatus withPreMaintenanceWindowStartTime(DateTime preM } /** - * Get the preMaintenanceWindowEndTime value. + * Get end Time for the Pre Maintenance Window. * * @return the preMaintenanceWindowEndTime value */ @@ -108,7 +108,7 @@ public DateTime preMaintenanceWindowEndTime() { } /** - * Set the preMaintenanceWindowEndTime value. + * Set end Time for the Pre Maintenance Window. * * @param preMaintenanceWindowEndTime the preMaintenanceWindowEndTime value to set * @return the MaintenanceRedeployStatus object itself. @@ -119,7 +119,7 @@ public MaintenanceRedeployStatus withPreMaintenanceWindowEndTime(DateTime preMai } /** - * Get the maintenanceWindowStartTime value. + * Get start Time for the Maintenance Window. * * @return the maintenanceWindowStartTime value */ @@ -128,7 +128,7 @@ public DateTime maintenanceWindowStartTime() { } /** - * Set the maintenanceWindowStartTime value. + * Set start Time for the Maintenance Window. * * @param maintenanceWindowStartTime the maintenanceWindowStartTime value to set * @return the MaintenanceRedeployStatus object itself. @@ -139,7 +139,7 @@ public MaintenanceRedeployStatus withMaintenanceWindowStartTime(DateTime mainten } /** - * Get the maintenanceWindowEndTime value. + * Get end Time for the Maintenance Window. * * @return the maintenanceWindowEndTime value */ @@ -148,7 +148,7 @@ public DateTime maintenanceWindowEndTime() { } /** - * Set the maintenanceWindowEndTime value. + * Set end Time for the Maintenance Window. * * @param maintenanceWindowEndTime the maintenanceWindowEndTime value to set * @return the MaintenanceRedeployStatus object itself. @@ -159,7 +159,7 @@ public MaintenanceRedeployStatus withMaintenanceWindowEndTime(DateTime maintenan } /** - * Get the lastOperationResultCode value. + * Get the Last Maintenance Operation Result Code. Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted'. * * @return the lastOperationResultCode value */ @@ -168,7 +168,7 @@ public MaintenanceOperationResultCodeTypes lastOperationResultCode() { } /** - * Set the lastOperationResultCode value. + * Set the Last Maintenance Operation Result Code. Possible values include: 'None', 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted'. * * @param lastOperationResultCode the lastOperationResultCode value to set * @return the MaintenanceRedeployStatus object itself. @@ -179,7 +179,7 @@ public MaintenanceRedeployStatus withLastOperationResultCode(MaintenanceOperatio } /** - * Get the lastOperationMessage value. + * Get message returned for the last Maintenance Operation. * * @return the lastOperationMessage value */ @@ -188,7 +188,7 @@ public String lastOperationMessage() { } /** - * Set the lastOperationMessage value. + * Set message returned for the last Maintenance Operation. * * @param lastOperationMessage the lastOperationMessage value to set * @return the MaintenanceRedeployStatus object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedArtifact.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedArtifact.java new file mode 100644 index 00000000000..513797f2001 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedArtifact.java @@ -0,0 +1,43 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The managed artifact. + */ +public class ManagedArtifact { + /** + * The managed artifact id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the managed artifact id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the managed artifact id. + * + * @param id the id value to set + * @return the ManagedArtifact object itself. + */ + public ManagedArtifact withId(String id) { + this.id = id; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ManagedDiskParametersInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedDiskParameters.java similarity index 62% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ManagedDiskParametersInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedDiskParameters.java index f5a1963720c..bc99da718df 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ManagedDiskParametersInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ManagedDiskParameters.java @@ -6,16 +6,15 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.StorageAccountTypes; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.azure.SubResource; /** * The parameters of a managed disk. */ -public class ManagedDiskParametersInner extends SubResource { +public class ManagedDiskParameters extends SubResource { /** * Specifies the storage account type for the managed disk. Possible values * are: Standard_LRS or Premium_LRS. Possible values include: @@ -25,7 +24,7 @@ public class ManagedDiskParametersInner extends SubResource { private StorageAccountTypes storageAccountType; /** - * Get the storageAccountType value. + * Get specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @return the storageAccountType value */ @@ -34,12 +33,12 @@ public StorageAccountTypes storageAccountType() { } /** - * Set the storageAccountType value. + * Set specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @param storageAccountType the storageAccountType value to set - * @return the ManagedDiskParametersInner object itself. + * @return the ManagedDiskParameters object itself. */ - public ManagedDiskParametersInner withStorageAccountType(StorageAccountTypes storageAccountType) { + public ManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { this.storageAccountType = storageAccountType; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/NetworkInterfaceReferenceInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkInterfaceReference.java similarity index 66% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/NetworkInterfaceReferenceInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkInterfaceReference.java index 72874d16db3..bc757904d85 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/NetworkInterfaceReferenceInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkInterfaceReference.java @@ -6,7 +6,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -16,7 +16,7 @@ * Describes a network interface reference. */ @JsonFlatten -public class NetworkInterfaceReferenceInner extends SubResource { +public class NetworkInterfaceReference extends SubResource { /** * Specifies the primary network interface in case the virtual machine has * more than 1 network interface. @@ -25,7 +25,7 @@ public class NetworkInterfaceReferenceInner extends SubResource { private Boolean primary; /** - * Get the primary value. + * Get specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @return the primary value */ @@ -34,12 +34,12 @@ public Boolean primary() { } /** - * Set the primary value. + * Set specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @param primary the primary value to set - * @return the NetworkInterfaceReferenceInner object itself. + * @return the NetworkInterfaceReference object itself. */ - public NetworkInterfaceReferenceInner withPrimary(Boolean primary) { + public NetworkInterfaceReference withPrimary(Boolean primary) { this.primary = primary; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkProfile.java index a5bfdfb1fd4..21ed1e0e428 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/NetworkProfile.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.compute; import java.util.List; -import com.microsoft.azure.management.compute.implementation.NetworkInterfaceReferenceInner; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -21,24 +20,24 @@ public class NetworkProfile { * with the virtual machine. */ @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; + private List networkInterfaces; /** - * Get the networkInterfaces value. + * Get specifies the list of resource Ids for the network interfaces associated with the virtual machine. * * @return the networkInterfaces value */ - public List networkInterfaces() { + public List networkInterfaces() { return this.networkInterfaces; } /** - * Set the networkInterfaces value. + * Set specifies the list of resource Ids for the network interfaces associated with the virtual machine. * * @param networkInterfaces the networkInterfaces value to set * @return the NetworkProfile object itself. */ - public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDisk.java index 0f6da66a142..1f570558fac 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDisk.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.implementation.ManagedDiskParametersInner; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -98,10 +97,10 @@ public class OSDisk { * The managed disk parameters. */ @JsonProperty(value = "managedDisk") - private ManagedDiskParametersInner managedDisk; + private ManagedDiskParameters managedDisk; /** - * Get the osType value. + * Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -110,7 +109,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the OSDisk object itself. @@ -121,7 +120,7 @@ public OSDisk withOsType(OperatingSystemTypes osType) { } /** - * Get the encryptionSettings value. + * Get specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15. * * @return the encryptionSettings value */ @@ -130,7 +129,7 @@ public DiskEncryptionSettings encryptionSettings() { } /** - * Set the encryptionSettings value. + * Set specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15. * * @param encryptionSettings the encryptionSettings value to set * @return the OSDisk object itself. @@ -141,7 +140,7 @@ public OSDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings) } /** - * Get the name value. + * Get the disk name. * * @return the name value */ @@ -150,7 +149,7 @@ public String name() { } /** - * Set the name value. + * Set the disk name. * * @param name the name value to set * @return the OSDisk object itself. @@ -161,7 +160,7 @@ public OSDisk withName(String name) { } /** - * Get the vhd value. + * Get the virtual hard disk. * * @return the vhd value */ @@ -170,7 +169,7 @@ public VirtualHardDisk vhd() { } /** - * Set the vhd value. + * Set the virtual hard disk. * * @param vhd the vhd value to set * @return the OSDisk object itself. @@ -181,7 +180,7 @@ public OSDisk withVhd(VirtualHardDisk vhd) { } /** - * Get the image value. + * Get the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. * * @return the image value */ @@ -190,7 +189,7 @@ public VirtualHardDisk image() { } /** - * Set the image value. + * Set the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. * * @param image the image value to set * @return the OSDisk object itself. @@ -201,7 +200,7 @@ public OSDisk withImage(VirtualHardDisk image) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -210,7 +209,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the OSDisk object itself. @@ -221,7 +220,7 @@ public OSDisk withCaching(CachingTypes caching) { } /** - * Get the writeAcceleratorEnabled value. + * Get specifies whether writeAccelerator should be enabled or disabled on the disk. * * @return the writeAcceleratorEnabled value */ @@ -230,7 +229,7 @@ public Boolean writeAcceleratorEnabled() { } /** - * Set the writeAcceleratorEnabled value. + * Set specifies whether writeAccelerator should be enabled or disabled on the disk. * * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set * @return the OSDisk object itself. @@ -241,7 +240,7 @@ public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { } /** - * Get the createOption value. + * Get specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @return the createOption value */ @@ -250,7 +249,7 @@ public DiskCreateOptionTypes createOption() { } /** - * Set the createOption value. + * Set specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @param createOption the createOption value to set * @return the OSDisk object itself. @@ -261,7 +260,7 @@ public OSDisk withCreateOption(DiskCreateOptionTypes createOption) { } /** - * Get the diskSizeGB value. + * Get specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @return the diskSizeGB value */ @@ -270,7 +269,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @param diskSizeGB the diskSizeGB value to set * @return the OSDisk object itself. @@ -281,21 +280,21 @@ public OSDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the managedDisk value. + * Get the managed disk parameters. * * @return the managedDisk value */ - public ManagedDiskParametersInner managedDisk() { + public ManagedDiskParameters managedDisk() { return this.managedDisk; } /** - * Set the managedDisk value. + * Set the managed disk parameters. * * @param managedDisk the managedDisk value to set * @return the OSDisk object itself. */ - public OSDisk withManagedDisk(ManagedDiskParametersInner managedDisk) { + public OSDisk withManagedDisk(ManagedDiskParameters managedDisk) { this.managedDisk = managedDisk; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDiskImage.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDiskImage.java index 32ccef8a67b..e3eda63bd4f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDiskImage.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSDiskImage.java @@ -22,7 +22,7 @@ public class OSDiskImage { private OperatingSystemTypes operatingSystem; /** - * Get the operatingSystem value. + * Get the operating system of the osDiskImage. Possible values include: 'Windows', 'Linux'. * * @return the operatingSystem value */ @@ -31,7 +31,7 @@ public OperatingSystemTypes operatingSystem() { } /** - * Set the operatingSystem value. + * Set the operating system of the osDiskImage. Possible values include: 'Windows', 'Linux'. * * @param operatingSystem the operatingSystem value to set * @return the OSDiskImage object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSProfile.java index 969df52f231..26fd4904299 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/OSProfile.java @@ -106,7 +106,15 @@ public class OSProfile { private List secrets; /** - * Get the computerName value. + * Specifies whether extension operations should be allowed on the virtual + * machine. <br><br>This may only be set to False when no + * extensions are present on the virtual machine. + */ + @JsonProperty(value = "allowExtensionOperations") + private Boolean allowExtensionOperations; + + /** + * Get specifies the host OS name of the virtual machine. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * * @return the computerName value */ @@ -115,7 +123,7 @@ public String computerName() { } /** - * Set the computerName value. + * Set specifies the host OS name of the virtual machine. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). * * @param computerName the computerName value to set * @return the OSProfile object itself. @@ -126,7 +134,7 @@ public OSProfile withComputerName(String computerName) { } /** - * Get the adminUsername value. + * Get specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the adminUsername value */ @@ -135,7 +143,7 @@ public String adminUsername() { } /** - * Set the adminUsername value. + * Set specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param adminUsername the adminUsername value to set * @return the OSProfile object itself. @@ -146,7 +154,7 @@ public OSProfile withAdminUsername(String adminUsername) { } /** - * Get the adminPassword value. + * Get specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). * * @return the adminPassword value */ @@ -155,7 +163,7 @@ public String adminPassword() { } /** - * Set the adminPassword value. + * Set specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). * * @param adminPassword the adminPassword value to set * @return the OSProfile object itself. @@ -166,7 +174,7 @@ public OSProfile withAdminPassword(String adminPassword) { } /** - * Get the customData value. + * Get specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the customData value */ @@ -175,7 +183,7 @@ public String customData() { } /** - * Set the customData value. + * Set specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param customData the customData value to set * @return the OSProfile object itself. @@ -186,7 +194,7 @@ public OSProfile withCustomData(String customData) { } /** - * Get the windowsConfiguration value. + * Get specifies Windows operating system settings on the virtual machine. * * @return the windowsConfiguration value */ @@ -195,7 +203,7 @@ public WindowsConfiguration windowsConfiguration() { } /** - * Set the windowsConfiguration value. + * Set specifies Windows operating system settings on the virtual machine. * * @param windowsConfiguration the windowsConfiguration value to set * @return the OSProfile object itself. @@ -206,7 +214,7 @@ public OSProfile withWindowsConfiguration(WindowsConfiguration windowsConfigurat } /** - * Get the linuxConfiguration value. + * Get specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the linuxConfiguration value */ @@ -215,7 +223,7 @@ public LinuxConfiguration linuxConfiguration() { } /** - * Set the linuxConfiguration value. + * Set specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param linuxConfiguration the linuxConfiguration value to set * @return the OSProfile object itself. @@ -226,7 +234,7 @@ public OSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { } /** - * Get the secrets value. + * Get specifies set of certificates that should be installed onto the virtual machine. * * @return the secrets value */ @@ -235,7 +243,7 @@ public List secrets() { } /** - * Set the secrets value. + * Set specifies set of certificates that should be installed onto the virtual machine. * * @param secrets the secrets value to set * @return the OSProfile object itself. @@ -245,4 +253,24 @@ public OSProfile withSecrets(List secrets) { return this; } + /** + * Get specifies whether extension operations should be allowed on the virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual machine. + * + * @return the allowExtensionOperations value + */ + public Boolean allowExtensionOperations() { + return this.allowExtensionOperations; + } + + /** + * Set specifies whether extension operations should be allowed on the virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual machine. + * + * @param allowExtensionOperations the allowExtensionOperations value to set + * @return the OSProfile object itself. + */ + public OSProfile withAllowExtensionOperations(Boolean allowExtensionOperations) { + this.allowExtensionOperations = allowExtensionOperations; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Plan.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Plan.java index 1397ea0974f..0f235f78fa6 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Plan.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Plan.java @@ -45,7 +45,7 @@ public class Plan { private String promotionCode; /** - * Get the name value. + * Get the plan ID. * * @return the name value */ @@ -54,7 +54,7 @@ public String name() { } /** - * Set the name value. + * Set the plan ID. * * @param name the name value to set * @return the Plan object itself. @@ -65,7 +65,7 @@ public Plan withName(String name) { } /** - * Get the publisher value. + * Get the publisher ID. * * @return the publisher value */ @@ -74,7 +74,7 @@ public String publisher() { } /** - * Set the publisher value. + * Set the publisher ID. * * @param publisher the publisher value to set * @return the Plan object itself. @@ -85,7 +85,7 @@ public Plan withPublisher(String publisher) { } /** - * Get the product value. + * Get specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. * * @return the product value */ @@ -94,7 +94,7 @@ public String product() { } /** - * Set the product value. + * Set specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. * * @param product the product value to set * @return the Plan object itself. @@ -105,7 +105,7 @@ public Plan withProduct(String product) { } /** - * Get the promotionCode value. + * Get the promotion code. * * @return the promotionCode value */ @@ -114,7 +114,7 @@ public String promotionCode() { } /** - * Set the promotionCode value. + * Set the promotion code. * * @param promotionCode the promotionCode value to set * @return the Plan object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/PurchasePlan.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/PurchasePlan.java index 13989d2720f..e5558f86665 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/PurchasePlan.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/PurchasePlan.java @@ -35,7 +35,7 @@ public class PurchasePlan { private String product; /** - * Get the publisher value. + * Get the publisher ID. * * @return the publisher value */ @@ -44,7 +44,7 @@ public String publisher() { } /** - * Set the publisher value. + * Set the publisher ID. * * @param publisher the publisher value to set * @return the PurchasePlan object itself. @@ -55,7 +55,7 @@ public PurchasePlan withPublisher(String publisher) { } /** - * Get the name value. + * Get the plan ID. * * @return the name value */ @@ -64,7 +64,7 @@ public String name() { } /** - * Set the name value. + * Set the plan ID. * * @param name the name value to set * @return the PurchasePlan object itself. @@ -75,7 +75,7 @@ public PurchasePlan withName(String name) { } /** - * Get the product value. + * Get specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. * * @return the product value */ @@ -84,7 +84,7 @@ public String product() { } /** - * Set the product value. + * Set specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. * * @param product the product value to set * @return the PurchasePlan object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RecommendedMachineConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RecommendedMachineConfiguration.java new file mode 100644 index 00000000000..19258d74d9b --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RecommendedMachineConfiguration.java @@ -0,0 +1,69 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the recommended machine configuration. + */ +public class RecommendedMachineConfiguration { + /** + * The vCPUs property. + */ + @JsonProperty(value = "vCPUs") + private ResourceRange vCPUs; + + /** + * The memory property. + */ + @JsonProperty(value = "memory") + private ResourceRange memory; + + /** + * Get the vCPUs value. + * + * @return the vCPUs value + */ + public ResourceRange vCPUs() { + return this.vCPUs; + } + + /** + * Set the vCPUs value. + * + * @param vCPUs the vCPUs value to set + * @return the RecommendedMachineConfiguration object itself. + */ + public RecommendedMachineConfiguration withVCPUs(ResourceRange vCPUs) { + this.vCPUs = vCPUs; + return this; + } + + /** + * Get the memory value. + * + * @return the memory value + */ + public ResourceRange memory() { + return this.memory; + } + + /** + * Set the memory value. + * + * @param memory the memory value to set + * @return the RecommendedMachineConfiguration object itself. + */ + public RecommendedMachineConfiguration withMemory(ResourceRange memory) { + this.memory = memory; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RegionalReplicationStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RegionalReplicationStatus.java new file mode 100644 index 00000000000..5722846c932 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RegionalReplicationStatus.java @@ -0,0 +1,78 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the regional replication status. + */ +public class RegionalReplicationStatus { + /** + * The region where the gallery image version is published to. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /** + * This is the regional replication state. Possible values include: + * 'Unknown', 'Replicating', 'Completed', 'Failed'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationState state; + + /** + * The details of the replication status. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * It indicates progress of the replication job. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private Integer progress; + + /** + * Get the region where the gallery image version is published to. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Get this is the regional replication state. Possible values include: 'Unknown', 'Replicating', 'Completed', 'Failed'. + * + * @return the state value + */ + public ReplicationState state() { + return this.state; + } + + /** + * Get the details of the replication status. + * + * @return the details value + */ + public String details() { + return this.details; + } + + /** + * Get it indicates progress of the replication job. + * + * @return the progress value + */ + public Integer progress() { + return this.progress; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationState.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationState.java new file mode 100644 index 00000000000..0c812ae2d94 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationState.java @@ -0,0 +1,47 @@ +/** + * 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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicationState. + */ +public final class ReplicationState extends ExpandableStringEnum { + /** Static value Unknown for ReplicationState. */ + public static final ReplicationState UNKNOWN = fromString("Unknown"); + + /** Static value Replicating for ReplicationState. */ + public static final ReplicationState REPLICATING = fromString("Replicating"); + + /** Static value Completed for ReplicationState. */ + public static final ReplicationState COMPLETED = fromString("Completed"); + + /** Static value Failed for ReplicationState. */ + public static final ReplicationState FAILED = fromString("Failed"); + + /** + * Creates or finds a ReplicationState from its string representation. + * @param name a name to look for + * @return the corresponding ReplicationState + */ + @JsonCreator + public static ReplicationState fromString(String name) { + return fromString(name, ReplicationState.class); + } + + /** + * @return known ReplicationState values + */ + public static Collection values() { + return values(ReplicationState.class); + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatus.java new file mode 100644 index 00000000000..5a2501c6751 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatus.java @@ -0,0 +1,50 @@ +/** + * 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; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the replication status of the gallery image version. + */ +public class ReplicationStatus { + /** + * This is the aggregated replication status based on the regional + * replication status. Possible values include: 'Unknown', 'InProgress', + * 'Completed', 'Failed'. + */ + @JsonProperty(value = "aggregatedState", access = JsonProperty.Access.WRITE_ONLY) + private AggregatedReplicationState aggregatedState; + + /** + * This is a summary of replication status for each region. + */ + @JsonProperty(value = "summary", access = JsonProperty.Access.WRITE_ONLY) + private List summary; + + /** + * Get this is the aggregated replication status based on the regional replication status. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'. + * + * @return the aggregatedState value + */ + public AggregatedReplicationState aggregatedState() { + return this.aggregatedState; + } + + /** + * Get this is a summary of replication status for each region. + * + * @return the summary value + */ + public List summary() { + return this.summary; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatusTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatusTypes.java new file mode 100644 index 00000000000..7ddd1d43545 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ReplicationStatusTypes.java @@ -0,0 +1,38 @@ +/** + * 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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicationStatusTypes. + */ +public final class ReplicationStatusTypes extends ExpandableStringEnum { + /** Static value ReplicationStatus for ReplicationStatusTypes. */ + public static final ReplicationStatusTypes REPLICATION_STATUS = fromString("ReplicationStatus"); + + /** + * Creates or finds a ReplicationStatusTypes from its string representation. + * @param name a name to look for + * @return the corresponding ReplicationStatusTypes + */ + @JsonCreator + public static ReplicationStatusTypes fromString(String name) { + return fromString(name, ReplicationStatusTypes.class); + } + + /** + * @return known ReplicationStatusTypes values + */ + public static Collection values() { + return values(ReplicationStatusTypes.class); + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RequestRateByIntervalInputInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RequestRateByIntervalInput.java similarity index 62% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RequestRateByIntervalInputInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RequestRateByIntervalInput.java index 8d6af4b271a..c890083b299 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RequestRateByIntervalInputInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RequestRateByIntervalInput.java @@ -6,16 +6,14 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.IntervalInMins; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.management.compute.LogAnalyticsInputBase; /** * Api request input for LogAnalytics getRequestRateByInterval Api. */ -public class RequestRateByIntervalInputInner extends LogAnalyticsInputBase { +public class RequestRateByIntervalInput extends LogAnalyticsInputBase { /** * Interval value in minutes used to create LogAnalytics call rate logs. * Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', @@ -25,7 +23,7 @@ public class RequestRateByIntervalInputInner extends LogAnalyticsInputBase { private IntervalInMins intervalLength; /** - * Get the intervalLength value. + * Get interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins'. * * @return the intervalLength value */ @@ -34,12 +32,12 @@ public IntervalInMins intervalLength() { } /** - * Set the intervalLength value. + * Set interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins'. * * @param intervalLength the intervalLength value to set - * @return the RequestRateByIntervalInputInner object itself. + * @return the RequestRateByIntervalInput object itself. */ - public RequestRateByIntervalInputInner withIntervalLength(IntervalInMins intervalLength) { + public RequestRateByIntervalInput withIntervalLength(IntervalInMins intervalLength) { this.intervalLength = intervalLength; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceRange.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceRange.java new file mode 100644 index 00000000000..70a72062645 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceRange.java @@ -0,0 +1,69 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the resource range. + */ +public class ResourceRange { + /** + * The minimum number of the resource. + */ + @JsonProperty(value = "min") + private Integer min; + + /** + * The maximum number of the resource. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get the minimum number of the resource. + * + * @return the min value + */ + public Integer min() { + return this.min; + } + + /** + * Set the minimum number of the resource. + * + * @param min the min value to set + * @return the ResourceRange object itself. + */ + public ResourceRange withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the maximum number of the resource. + * + * @return the max value + */ + public Integer max() { + return this.max; + } + + /** + * Set the maximum number of the resource. + * + * @param max the max value to set + * @return the ResourceRange object itself. + */ + public ResourceRange withMax(Integer max) { + this.max = max; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapabilities.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapabilities.java index f075babef4e..ba0b34afd36 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapabilities.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapabilities.java @@ -27,7 +27,7 @@ public class ResourceSkuCapabilities { private String value; /** - * Get the name value. + * Get an invariant to describe the feature. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Get the value value. + * Get an invariant if the feature is measured by quantity. * * @return the value value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapacity.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapacity.java index 49d2ac70cbf..7fb16cafbbd 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapacity.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCapacity.java @@ -40,7 +40,7 @@ public class ResourceSkuCapacity { private ResourceSkuCapacityScaleType scaleType; /** - * Get the minimum value. + * Get the minimum capacity. * * @return the minimum value */ @@ -49,7 +49,7 @@ public Long minimum() { } /** - * Get the maximum value. + * Get the maximum capacity that can be set. * * @return the maximum value */ @@ -58,7 +58,7 @@ public Long maximum() { } /** - * Get the defaultProperty value. + * Get the default capacity. * * @return the defaultProperty value */ @@ -67,7 +67,7 @@ public Long defaultProperty() { } /** - * Get the scaleType value. + * Get the scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None'. * * @return the scaleType value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCosts.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCosts.java index 496b2876e43..6e04c044516 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCosts.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuCosts.java @@ -33,7 +33,7 @@ public class ResourceSkuCosts { private String extendedUnit; /** - * Get the meterID value. + * Get used for querying price from commerce. * * @return the meterID value */ @@ -42,7 +42,7 @@ public String meterID() { } /** - * Get the quantity value. + * Get the multiplier is needed to extend the base metered cost. * * @return the quantity value */ @@ -51,7 +51,7 @@ public Long quantity() { } /** - * Get the extendedUnit value. + * Get an invariant to show the extended unit. * * @return the extendedUnit value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuLocationInfo.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuLocationInfo.java index f858bb77738..d47f6ff9d7e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuLocationInfo.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuLocationInfo.java @@ -28,7 +28,7 @@ public class ResourceSkuLocationInfo { private List zones; /** - * Get the location value. + * Get location of the SKU. * * @return the location value */ @@ -37,7 +37,7 @@ public String location() { } /** - * Get the zones value. + * Get list of availability zones where the SKU is supported. * * @return the zones value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionInfo.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionInfo.java index 3e80e2e5d9d..ec57f0f2ee3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionInfo.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionInfo.java @@ -28,7 +28,7 @@ public class ResourceSkuRestrictionInfo { private List zones; /** - * Get the locations value. + * Get locations where the SKU is restricted. * * @return the locations value */ @@ -37,7 +37,7 @@ public List locations() { } /** - * Get the zones value. + * Get list of availability zones where the SKU is restricted. * * @return the zones value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictions.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictions.java index 428fcbdf411..f128f1f407c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictions.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictions.java @@ -42,7 +42,7 @@ public class ResourceSkuRestrictions { private ResourceSkuRestrictionsReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. Possible values include: 'Location', 'Zone'. * * @return the type value */ @@ -51,7 +51,7 @@ public ResourceSkuRestrictionsType type() { } /** - * Get the values value. + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. * * @return the values value */ @@ -60,7 +60,7 @@ public List values() { } /** - * Get the restrictionInfo value. + * Get the information about the restriction where the SKU cannot be used. * * @return the restrictionInfo value */ @@ -69,7 +69,7 @@ public ResourceSkuRestrictionInfo restrictionInfo() { } /** - * Get the reasonCode value. + * Get the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. * * @return the reasonCode value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceUpdate.java deleted file mode 100644 index b04cf9c4d61..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceUpdate.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 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; - -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The Resource model definition. - */ -public class ResourceUpdate { - /** - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * The sku property. - */ - @JsonProperty(value = "sku") - private DiskSku sku; - - /** - * Get the tags value. - * - * @return the tags value - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags value. - * - * @param tags the tags value to set - * @return the ResourceUpdate object itself. - */ - public ResourceUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the sku value. - * - * @return the sku value - */ - public DiskSku sku() { - return this.sku; - } - - /** - * Set the sku value. - * - * @param sku the sku value to set - * @return the ResourceUpdate object itself. - */ - public ResourceUpdate withSku(DiskSku sku) { - this.sku = sku; - return this; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollbackStatusInfo.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollbackStatusInfo.java new file mode 100644 index 00000000000..e01e0eaf6cd --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollbackStatusInfo.java @@ -0,0 +1,63 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about rollback on failed VM instances after a OS Upgrade + * operation. + */ +public class RollbackStatusInfo { + /** + * The number of instances which have been successfully rolled back. + */ + @JsonProperty(value = "successfullyRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer successfullyRolledbackInstanceCount; + + /** + * The number of instances which failed to rollback. + */ + @JsonProperty(value = "failedRolledbackInstanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failedRolledbackInstanceCount; + + /** + * Error details if OS rollback failed. + */ + @JsonProperty(value = "rollbackError", access = JsonProperty.Access.WRITE_ONLY) + private ApiError rollbackError; + + /** + * Get the number of instances which have been successfully rolled back. + * + * @return the successfullyRolledbackInstanceCount value + */ + public Integer successfullyRolledbackInstanceCount() { + return this.successfullyRolledbackInstanceCount; + } + + /** + * Get the number of instances which failed to rollback. + * + * @return the failedRolledbackInstanceCount value + */ + public Integer failedRolledbackInstanceCount() { + return this.failedRolledbackInstanceCount; + } + + /** + * Get error details if OS rollback failed. + * + * @return the rollbackError value + */ + public ApiError rollbackError() { + return this.rollbackError; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradePolicy.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradePolicy.java index 1b11eb5fc54..3d66d15d05d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradePolicy.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradePolicy.java @@ -53,7 +53,7 @@ public class RollingUpgradePolicy { private String pauseTimeBetweenBatches; /** - * Get the maxBatchInstancePercent value. + * Get the maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. * * @return the maxBatchInstancePercent value */ @@ -62,7 +62,7 @@ public Integer maxBatchInstancePercent() { } /** - * Set the maxBatchInstancePercent value. + * Set the maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. * * @param maxBatchInstancePercent the maxBatchInstancePercent value to set * @return the RollingUpgradePolicy object itself. @@ -73,7 +73,7 @@ public RollingUpgradePolicy withMaxBatchInstancePercent(Integer maxBatchInstance } /** - * Get the maxUnhealthyInstancePercent value. + * Get the maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. * * @return the maxUnhealthyInstancePercent value */ @@ -82,7 +82,7 @@ public Integer maxUnhealthyInstancePercent() { } /** - * Set the maxUnhealthyInstancePercent value. + * Set the maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. * * @param maxUnhealthyInstancePercent the maxUnhealthyInstancePercent value to set * @return the RollingUpgradePolicy object itself. @@ -93,7 +93,7 @@ public RollingUpgradePolicy withMaxUnhealthyInstancePercent(Integer maxUnhealthy } /** - * Get the maxUnhealthyUpgradedInstancePercent value. + * Get the maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. * * @return the maxUnhealthyUpgradedInstancePercent value */ @@ -102,7 +102,7 @@ public Integer maxUnhealthyUpgradedInstancePercent() { } /** - * Set the maxUnhealthyUpgradedInstancePercent value. + * Set the maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. * * @param maxUnhealthyUpgradedInstancePercent the maxUnhealthyUpgradedInstancePercent value to set * @return the RollingUpgradePolicy object itself. @@ -113,7 +113,7 @@ public RollingUpgradePolicy withMaxUnhealthyUpgradedInstancePercent(Integer maxU } /** - * Get the pauseTimeBetweenBatches value. + * Get the wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). * * @return the pauseTimeBetweenBatches value */ @@ -122,7 +122,7 @@ public String pauseTimeBetweenBatches() { } /** - * Set the pauseTimeBetweenBatches value. + * Set the wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). * * @param pauseTimeBetweenBatches the pauseTimeBetweenBatches value to set * @return the RollingUpgradePolicy object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeProgressInfo.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeProgressInfo.java index 3a789fcd608..fdcfc3ba0cf 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeProgressInfo.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeProgressInfo.java @@ -40,7 +40,7 @@ public class RollingUpgradeProgressInfo { private Integer pendingInstanceCount; /** - * Get the successfulInstanceCount value. + * Get the number of instances that have been successfully upgraded. * * @return the successfulInstanceCount value */ @@ -49,7 +49,7 @@ public Integer successfulInstanceCount() { } /** - * Get the failedInstanceCount value. + * Get the number of instances that have failed to be upgraded successfully. * * @return the failedInstanceCount value */ @@ -58,7 +58,7 @@ public Integer failedInstanceCount() { } /** - * Get the inProgressInstanceCount value. + * Get the number of instances that are currently being upgraded. * * @return the inProgressInstanceCount value */ @@ -67,7 +67,7 @@ public Integer inProgressInstanceCount() { } /** - * Get the pendingInstanceCount value. + * Get the number of instances that have not yet begun to be upgraded. * * @return the pendingInstanceCount value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeRunningStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeRunningStatus.java index d90c22bf549..1bc1520c9f5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeRunningStatus.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RollingUpgradeRunningStatus.java @@ -42,7 +42,7 @@ public class RollingUpgradeRunningStatus { private DateTime lastActionTime; /** - * Get the code value. + * Get code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'. * * @return the code value */ @@ -51,7 +51,7 @@ public RollingUpgradeStatusCode code() { } /** - * Get the startTime value. + * Get start time of the upgrade. * * @return the startTime value */ @@ -60,7 +60,7 @@ public DateTime startTime() { } /** - * Get the lastAction value. + * Get the last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel'. * * @return the lastAction value */ @@ -69,7 +69,7 @@ public RollingUpgradeActionType lastAction() { } /** - * Get the lastActionTime value. + * Get last action time of the upgrade. * * @return the lastActionTime value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandInputInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInput.java similarity index 66% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandInputInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInput.java index 73b454acc6e..c527a58613c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandInputInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInput.java @@ -6,16 +6,15 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import java.util.List; -import com.microsoft.azure.management.compute.RunCommandInputParameter; import com.fasterxml.jackson.annotation.JsonProperty; /** * Capture Virtual Machine parameters. */ -public class RunCommandInputInner { +public class RunCommandInput { /** * The run command id. */ @@ -36,7 +35,7 @@ public class RunCommandInputInner { private List parameters; /** - * Get the commandId value. + * Get the run command id. * * @return the commandId value */ @@ -45,18 +44,18 @@ public String commandId() { } /** - * Set the commandId value. + * Set the run command id. * * @param commandId the commandId value to set - * @return the RunCommandInputInner object itself. + * @return the RunCommandInput object itself. */ - public RunCommandInputInner withCommandId(String commandId) { + public RunCommandInput withCommandId(String commandId) { this.commandId = commandId; return this; } /** - * Get the script value. + * Get optional. The script to be executed. When this value is given, the given script will override the default script of the command. * * @return the script value */ @@ -65,18 +64,18 @@ public List script() { } /** - * Set the script value. + * Set optional. The script to be executed. When this value is given, the given script will override the default script of the command. * * @param script the script value to set - * @return the RunCommandInputInner object itself. + * @return the RunCommandInput object itself. */ - public RunCommandInputInner withScript(List script) { + public RunCommandInput withScript(List script) { this.script = script; return this; } /** - * Get the parameters value. + * Get the run command parameters. * * @return the parameters value */ @@ -85,12 +84,12 @@ public List parameters() { } /** - * Set the parameters value. + * Set the run command parameters. * * @param parameters the parameters value to set - * @return the RunCommandInputInner object itself. + * @return the RunCommandInput object itself. */ - public RunCommandInputInner withParameters(List parameters) { + public RunCommandInput withParameters(List parameters) { this.parameters = parameters; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInputParameter.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInputParameter.java index 0ea5db5de6d..12b43520f68 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInputParameter.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandInputParameter.java @@ -27,7 +27,7 @@ public class RunCommandInputParameter { private String value; /** - * Get the name value. + * Get the run command parameter name. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Set the name value. + * Set the run command parameter name. * * @param name the name value to set * @return the RunCommandInputParameter object itself. @@ -47,7 +47,7 @@ public RunCommandInputParameter withName(String name) { } /** - * Get the value value. + * Get the run command parameter value. * * @return the value value */ @@ -56,7 +56,7 @@ public String value() { } /** - * Set the value value. + * Set the run command parameter value. * * @param value the value value to set * @return the RunCommandInputParameter object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandParameterDefinition.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandParameterDefinition.java index a984919119c..488723675cb 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandParameterDefinition.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandParameterDefinition.java @@ -39,7 +39,7 @@ public class RunCommandParameterDefinition { private Boolean required; /** - * Get the name value. + * Get the run command parameter name. * * @return the name value */ @@ -48,7 +48,7 @@ public String name() { } /** - * Set the name value. + * Set the run command parameter name. * * @param name the name value to set * @return the RunCommandParameterDefinition object itself. @@ -59,7 +59,7 @@ public RunCommandParameterDefinition withName(String name) { } /** - * Get the type value. + * Get the run command parameter type. * * @return the type value */ @@ -68,7 +68,7 @@ public String type() { } /** - * Set the type value. + * Set the run command parameter type. * * @param type the type value to set * @return the RunCommandParameterDefinition object itself. @@ -79,7 +79,7 @@ public RunCommandParameterDefinition withType(String type) { } /** - * Get the defaultValue value. + * Get the run command parameter default value. * * @return the defaultValue value */ @@ -88,7 +88,7 @@ public String defaultValue() { } /** - * Set the defaultValue value. + * Set the run command parameter default value. * * @param defaultValue the defaultValue value to set * @return the RunCommandParameterDefinition object itself. @@ -99,7 +99,7 @@ public RunCommandParameterDefinition withDefaultValue(String defaultValue) { } /** - * Get the required value. + * Get the run command parameter required. * * @return the required value */ @@ -108,7 +108,7 @@ public Boolean required() { } /** - * Set the required value. + * Set the run command parameter required. * * @param required the required value to set * @return the RunCommandParameterDefinition object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandResultInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandResult.java similarity index 71% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandResultInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandResult.java index 69e6d749058..4e1b188fa29 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandResultInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/RunCommandResult.java @@ -6,7 +6,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -15,7 +15,7 @@ * Run command operation response. */ @JsonFlatten -public class RunCommandResultInner extends OperationStatusResponseInner { +public class RunCommandResult { /** * Operation output data (raw JSON). */ @@ -23,7 +23,7 @@ public class RunCommandResultInner extends OperationStatusResponseInner { private Object output; /** - * Get the output value. + * Get operation output data (raw JSON). * * @return the output value */ @@ -32,12 +32,12 @@ public Object output() { } /** - * Set the output value. + * Set operation output data (raw JSON). * * @param output the output value to set - * @return the RunCommandResultInner object itself. + * @return the RunCommandResult object itself. */ - public RunCommandResultInner withOutput(Object output) { + public RunCommandResult withOutput(Object output) { this.output = output; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ScaleTier.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ScaleTier.java new file mode 100644 index 00000000000..b876d92b6b5 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ScaleTier.java @@ -0,0 +1,41 @@ +/** + * 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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ScaleTier. + */ +public final class ScaleTier extends ExpandableStringEnum { + /** Static value S30 for ScaleTier. */ + public static final ScaleTier S30 = fromString("S30"); + + /** Static value S100 for ScaleTier. */ + public static final ScaleTier S100 = fromString("S100"); + + /** + * Creates or finds a ScaleTier from its string representation. + * @param name a name to look for + * @return the corresponding ScaleTier + */ + @JsonCreator + public static ScaleTier fromString(String name) { + return fromString(name, ScaleTier.class); + } + + /** + * @return known ScaleTier values + */ + public static Collection values() { + return values(ScaleTier.class); + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Sku.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Sku.java index 248ba652d28..20193f38b01 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Sku.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/Sku.java @@ -35,7 +35,7 @@ public class Sku { private Long capacity; /** - * Get the name value. + * Get the sku name. * * @return the name value */ @@ -44,7 +44,7 @@ public String name() { } /** - * Set the name value. + * Set the sku name. * * @param name the name value to set * @return the Sku object itself. @@ -55,7 +55,7 @@ public Sku withName(String name) { } /** - * Get the tier value. + * Get specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**. * * @return the tier value */ @@ -64,7 +64,7 @@ public String tier() { } /** - * Set the tier value. + * Set specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**. * * @param tier the tier value to set * @return the Sku object itself. @@ -75,7 +75,7 @@ public Sku withTier(String tier) { } /** - * Get the capacity value. + * Get specifies the number of virtual machines in the scale set. * * @return the capacity value */ @@ -84,7 +84,7 @@ public Long capacity() { } /** - * Set the capacity value. + * Set specifies the number of virtual machines in the scale set. * * @param capacity the capacity value to set * @return the Sku object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotSku.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotSku.java index 93f0786a195..a4dc674d5d5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotSku.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotSku.java @@ -28,7 +28,7 @@ public class SnapshotSku { private String tier; /** - * Get the name value. + * Get the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS'. * * @return the name value */ @@ -37,7 +37,7 @@ public SnapshotStorageAccountTypes name() { } /** - * Set the name value. + * Set the sku name. Possible values include: 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS'. * * @param name the name value to set * @return the SnapshotSku object itself. @@ -48,7 +48,7 @@ public SnapshotSku withName(SnapshotStorageAccountTypes name) { } /** - * Get the tier value. + * Get the sku tier. * * @return the tier value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotUpdate.java new file mode 100644 index 00000000000..985d7d24e4a --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotUpdate.java @@ -0,0 +1,154 @@ +/** + * 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; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Snapshot update resource. + */ +@JsonFlatten +public class SnapshotUpdate { + /** + * the Operating System type. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /** + * If creationData.createOption is Empty, this field is mandatory and it + * indicates the size of the VHD to create. If this field is present for + * updates or creation with other options, it indicates a resize. Resizes + * are only allowed if the disk is not attached to a running VM, and can + * only increase the disk's size. + */ + @JsonProperty(value = "properties.diskSizeGB") + private Integer diskSizeGB; + + /** + * Encryption settings for disk or snapshot. + */ + @JsonProperty(value = "properties.encryptionSettings") + private EncryptionSettings encryptionSettings; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private SnapshotSku sku; + + /** + * Get the Operating System type. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating System type. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + * + * @param diskSizeGB the diskSizeGB value to set + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get encryption settings for disk or snapshot. + * + * @return the encryptionSettings value + */ + public EncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set encryption settings for disk or snapshot. + * + * @param encryptionSettings the encryptionSettings value to set + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withEncryptionSettings(EncryptionSettings encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public SnapshotSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the SnapshotUpdate object itself. + */ + public SnapshotUpdate withSku(SnapshotSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SourceVault.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SourceVault.java index 1b47488a9c7..833bdf8916c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SourceVault.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SourceVault.java @@ -22,7 +22,7 @@ public class SourceVault { private String id; /** - * Get the id value. + * Get resource Id. * * @return the id value */ @@ -31,7 +31,7 @@ public String id() { } /** - * Set the id value. + * Set resource Id. * * @param id the id value to set * @return the SourceVault object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshConfiguration.java index c760d2688f6..29883925e5d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshConfiguration.java @@ -22,7 +22,7 @@ public class SshConfiguration { private List publicKeys; /** - * Get the publicKeys value. + * Get the list of SSH public keys used to authenticate with linux based VMs. * * @return the publicKeys value */ @@ -31,7 +31,7 @@ public List publicKeys() { } /** - * Set the publicKeys value. + * Set the list of SSH public keys used to authenticate with linux based VMs. * * @param publicKeys the publicKeys value to set * @return the SshConfiguration object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshPublicKey.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshPublicKey.java index 75213f2fbfe..40876d9b0ca 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshPublicKey.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SshPublicKey.java @@ -34,7 +34,7 @@ public class SshPublicKey { private String keyData; /** - * Get the path value. + * Get specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. * * @return the path value */ @@ -43,7 +43,7 @@ public String path() { } /** - * Set the path value. + * Set specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. * * @param path the path value to set * @return the SshPublicKey object itself. @@ -54,7 +54,7 @@ public SshPublicKey withPath(String path) { } /** - * Get the keyData value. + * Get sSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the keyData value */ @@ -63,7 +63,7 @@ public String keyData() { } /** - * Set the keyData value. + * Set sSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param keyData the keyData value to set * @return the SshPublicKey object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/StorageAccountTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/StorageAccountTypes.java index 0f30ca9c570..69eb1306a6f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/StorageAccountTypes.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/StorageAccountTypes.java @@ -22,6 +22,9 @@ public final class StorageAccountTypes extends ExpandableStringEnum dataDisks; /** - * Get the imageReference value. + * Get specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. * * @return the imageReference value */ - public ImageReferenceInner imageReference() { + public ImageReference imageReference() { return this.imageReference; } /** - * Set the imageReference value. + * Set specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. * * @param imageReference the imageReference value to set * @return the StorageProfile object itself. */ - public StorageProfile withImageReference(ImageReferenceInner imageReference) { + public StorageProfile withImageReference(ImageReference imageReference) { this.imageReference = imageReference; return this; } /** - * Get the osDisk value. + * Get specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the osDisk value */ @@ -74,7 +73,7 @@ public OSDisk osDisk() { } /** - * Set the osDisk value. + * Set specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param osDisk the osDisk value to set * @return the StorageProfile object itself. @@ -85,7 +84,7 @@ public StorageProfile withOsDisk(OSDisk osDisk) { } /** - * Get the dataDisks value. + * Get specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the dataDisks value */ @@ -94,7 +93,7 @@ public List dataDisks() { } /** - * Set the dataDisks value. + * Set specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param dataDisks the dataDisks value to set * @return the StorageProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SubResourceReadOnly.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SubResourceReadOnly.java index 6220622f1b2..7e7864bed74 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SubResourceReadOnly.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SubResourceReadOnly.java @@ -21,7 +21,7 @@ public class SubResourceReadOnly { private String id; /** - * Get the id value. + * Get resource Id. * * @return the id value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ThrottledRequestsInputInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ThrottledRequestsInput.java similarity index 60% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ThrottledRequestsInputInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ThrottledRequestsInput.java index 34a71d127f5..4fa3cdc0439 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ThrottledRequestsInputInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ThrottledRequestsInput.java @@ -6,12 +6,11 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.LogAnalyticsInputBase; /** * Api request input for LogAnalytics getThrottledRequests Api. */ -public class ThrottledRequestsInputInner extends LogAnalyticsInputBase { +public class ThrottledRequestsInput extends LogAnalyticsInputBase { } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpdateResource.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpdateResource.java index 17950d877ad..c8a4112c1ef 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpdateResource.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpdateResource.java @@ -22,7 +22,7 @@ public class UpdateResource { private Map tags; /** - * Get the tags value. + * Get resource tags. * * @return the tags value */ @@ -31,7 +31,7 @@ public Map tags() { } /** - * Set the tags value. + * Set resource tags. * * @param tags the tags value to set * @return the UpdateResource object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java new file mode 100644 index 00000000000..64bd49efddc --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java @@ -0,0 +1,108 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes each OS upgrade on the Virtual Machine Scale Set. + */ +public class UpgradeOperationHistoricalStatusInfoProperties { + /** + * Information about the overall status of the upgrade operation. + */ + @JsonProperty(value = "runningStatus", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationHistoryStatus runningStatus; + + /** + * Counts of the VM's in each state. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private RollingUpgradeProgressInfo progress; + + /** + * Error Details for this upgrade if there are any. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Invoker of the Upgrade Operation. Possible values include: 'Unknown', + * 'User', 'Platform'. + */ + @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationInvoker startedBy; + + /** + * Image Reference details. + */ + @JsonProperty(value = "targetImageReference", access = JsonProperty.Access.WRITE_ONLY) + private ImageReference targetImageReference; + + /** + * Information about OS rollback if performed. + */ + @JsonProperty(value = "rollbackInfo", access = JsonProperty.Access.WRITE_ONLY) + private RollbackStatusInfo rollbackInfo; + + /** + * Get information about the overall status of the upgrade operation. + * + * @return the runningStatus value + */ + public UpgradeOperationHistoryStatus runningStatus() { + return this.runningStatus; + } + + /** + * Get counts of the VM's in each state. + * + * @return the progress value + */ + public RollingUpgradeProgressInfo progress() { + return this.progress; + } + + /** + * Get error Details for this upgrade if there are any. + * + * @return the error value + */ + public ApiError error() { + return this.error; + } + + /** + * Get invoker of the Upgrade Operation. Possible values include: 'Unknown', 'User', 'Platform'. + * + * @return the startedBy value + */ + public UpgradeOperationInvoker startedBy() { + return this.startedBy; + } + + /** + * Get image Reference details. + * + * @return the targetImageReference value + */ + public ImageReference targetImageReference() { + return this.targetImageReference; + } + + /** + * Get information about OS rollback if performed. + * + * @return the rollbackInfo value + */ + public RollbackStatusInfo rollbackInfo() { + return this.rollbackInfo; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoryStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoryStatus.java new file mode 100644 index 00000000000..e098a2e09c1 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationHistoryStatus.java @@ -0,0 +1,64 @@ +/** + * 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; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about the current running state of the overall upgrade. + */ +public class UpgradeOperationHistoryStatus { + /** + * Code indicating the current status of the upgrade. Possible values + * include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeState code; + + /** + * Start time of the upgrade. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * End time of the upgrade. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * Get code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'. + * + * @return the code value + */ + public UpgradeState code() { + return this.code; + } + + /** + * Get start time of the upgrade. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get end time of the upgrade. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationInvoker.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationInvoker.java new file mode 100644 index 00000000000..5347e60514b --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeOperationInvoker.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; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UpgradeOperationInvoker. + */ +public enum UpgradeOperationInvoker { + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value User. */ + USER("User"), + + /** Enum value Platform. */ + PLATFORM("Platform"); + + /** The actual serialized value for a UpgradeOperationInvoker instance. */ + private String value; + + UpgradeOperationInvoker(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpgradeOperationInvoker instance. + * + * @param value the serialized value to parse. + * @return the parsed UpgradeOperationInvoker object, or null if unable to parse. + */ + @JsonCreator + public static UpgradeOperationInvoker fromString(String value) { + UpgradeOperationInvoker[] items = UpgradeOperationInvoker.values(); + for (UpgradeOperationInvoker item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradePolicy.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradePolicy.java index a514197931e..97e16ae4a37 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradePolicy.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradePolicy.java @@ -41,7 +41,13 @@ public class UpgradePolicy { private Boolean automaticOSUpgrade; /** - * Get the mode value. + * Configuration parameters used for performing automatic OS Upgrade. + */ + @JsonProperty(value = "autoOSUpgradePolicy") + private AutoOSUpgradePolicy autoOSUpgradePolicy; + + /** + * Get specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling'. * * @return the mode value */ @@ -50,7 +56,7 @@ public UpgradeMode mode() { } /** - * Set the mode value. + * Set specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling'. * * @param mode the mode value to set * @return the UpgradePolicy object itself. @@ -61,7 +67,7 @@ public UpgradePolicy withMode(UpgradeMode mode) { } /** - * Get the rollingUpgradePolicy value. + * Get the configuration parameters used while performing a rolling upgrade. * * @return the rollingUpgradePolicy value */ @@ -70,7 +76,7 @@ public RollingUpgradePolicy rollingUpgradePolicy() { } /** - * Set the rollingUpgradePolicy value. + * Set the configuration parameters used while performing a rolling upgrade. * * @param rollingUpgradePolicy the rollingUpgradePolicy value to set * @return the UpgradePolicy object itself. @@ -81,7 +87,7 @@ public UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgrad } /** - * Get the automaticOSUpgrade value. + * Get whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available. * * @return the automaticOSUpgrade value */ @@ -90,7 +96,7 @@ public Boolean automaticOSUpgrade() { } /** - * Set the automaticOSUpgrade value. + * Set whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available. * * @param automaticOSUpgrade the automaticOSUpgrade value to set * @return the UpgradePolicy object itself. @@ -100,4 +106,24 @@ public UpgradePolicy withAutomaticOSUpgrade(Boolean automaticOSUpgrade) { return this; } + /** + * Get configuration parameters used for performing automatic OS Upgrade. + * + * @return the autoOSUpgradePolicy value + */ + public AutoOSUpgradePolicy autoOSUpgradePolicy() { + return this.autoOSUpgradePolicy; + } + + /** + * Set configuration parameters used for performing automatic OS Upgrade. + * + * @param autoOSUpgradePolicy the autoOSUpgradePolicy value to set + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withAutoOSUpgradePolicy(AutoOSUpgradePolicy autoOSUpgradePolicy) { + this.autoOSUpgradePolicy = autoOSUpgradePolicy; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeState.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeState.java new file mode 100644 index 00000000000..4c8c2239ed9 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UpgradeState.java @@ -0,0 +1,59 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UpgradeState. + */ +public enum UpgradeState { + /** Enum value RollingForward. */ + ROLLING_FORWARD("RollingForward"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Faulted. */ + FAULTED("Faulted"); + + /** The actual serialized value for a UpgradeState instance. */ + private String value; + + UpgradeState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UpgradeState instance. + * + * @param value the serialized value to parse. + * @return the parsed UpgradeState object, or null if unable to parse. + */ + @JsonCreator + public static UpgradeState fromString(String value) { + UpgradeState[] items = UpgradeState.values(); + for (UpgradeState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UsageName.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UsageName.java index e70e4eb272d..b01d4504d84 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UsageName.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get the name of the resource. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Set the value value. + * Set the name of the resource. * * @param value the value value to set * @return the UsageName object itself. @@ -47,7 +47,7 @@ public UsageName withValue(String value) { } /** - * Get the localizedValue value. + * Get the localized name of the resource. * * @return the localizedValue value */ @@ -56,7 +56,7 @@ public String localizedValue() { } /** - * Set the localizedValue value. + * Set the localized name of the resource. * * @param localizedValue the localizedValue value to set * @return the UsageName object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultCertificate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultCertificate.java index 52ca9c4d4e0..99105b96fbd 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultCertificate.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultCertificate.java @@ -43,7 +43,7 @@ public class VaultCertificate { private String certificateStore; /** - * Get the certificateUrl value. + * Get this is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. * * @return the certificateUrl value */ @@ -52,7 +52,7 @@ public String certificateUrl() { } /** - * Set the certificateUrl value. + * Set this is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. * * @param certificateUrl the certificateUrl value to set * @return the VaultCertificate object itself. @@ -63,7 +63,7 @@ public VaultCertificate withCertificateUrl(String certificateUrl) { } /** - * Get the certificateStore value. + * Get for Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbpring>.prv for private key. Both of these files are .pem formatted. * * @return the certificateStore value */ @@ -72,7 +72,7 @@ public String certificateStore() { } /** - * Set the certificateStore value. + * Set for Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbpring>.prv for private key. Both of these files are .pem formatted. * * @param certificateStore the certificateStore value to set * @return the VaultCertificate object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultSecretGroup.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultSecretGroup.java index ab528694c0a..3f12d7ca2a4 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultSecretGroup.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VaultSecretGroup.java @@ -31,7 +31,7 @@ public class VaultSecretGroup { private List vaultCertificates; /** - * Get the sourceVault value. + * Get the relative URL of the Key Vault containing all of the certificates in VaultCertificates. * * @return the sourceVault value */ @@ -40,7 +40,7 @@ public SubResource sourceVault() { } /** - * Set the sourceVault value. + * Set the relative URL of the Key Vault containing all of the certificates in VaultCertificates. * * @param sourceVault the sourceVault value to set * @return the VaultSecretGroup object itself. @@ -51,7 +51,7 @@ public VaultSecretGroup withSourceVault(SubResource sourceVault) { } /** - * Get the vaultCertificates value. + * Get the list of key vault references in SourceVault which contain certificates. * * @return the vaultCertificates value */ @@ -60,7 +60,7 @@ public List vaultCertificates() { } /** - * Set the vaultCertificates value. + * Set the list of key vault references in SourceVault which contain certificates. * * @param vaultCertificates the vaultCertificates value to set * @return the VaultSecretGroup object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualHardDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualHardDisk.java index b4cde002bf2..1f3c6b7d246 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualHardDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualHardDisk.java @@ -21,7 +21,7 @@ public class VirtualHardDisk { private String uri; /** - * Get the uri value. + * Get specifies the virtual hard disk's uri. * * @return the uri value */ @@ -30,7 +30,7 @@ public String uri() { } /** - * Set the uri value. + * Set specifies the virtual hard disk's uri. * * @param uri the uri value to set * @return the VirtualHardDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachine.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachine.java index 7451d0f4356..0e7739cd43a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachine.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachine.java @@ -1526,15 +1526,6 @@ interface WithSystemAssignedManagedServiceIdentity { */ @Beta(Beta.SinceVersion.V1_5_0) WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in the virtual machine. - * - * @param tokenPort the port on the virtual machine where access token is available - * @return the next stage of the definition - */ - @Beta(Beta.SinceVersion.V1_5_0) - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(int tokenPort); } /** @@ -2019,14 +2010,12 @@ interface WithSystemAssignedManagedServiceIdentity { WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedManagedServiceIdentity(); /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in - * the virtual machine. + * Specifies that System Assigned (Local) Managed Service Identity needs to be disabled. * - * @param tokenPort the port on the virtual machine where access token is available * @return the next stage of the update */ - @Beta(Beta.SinceVersion.V1_5_0) - WithSystemAssignedIdentityBasedAccessOrUpdate withSystemAssignedManagedServiceIdentity(int tokenPort); + @Beta(Beta.SinceVersion.V1_13_0) + Update withoutSystemAssignedManagedServiceIdentity(); } /** diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineAgentInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineAgentInstanceView.java index a910f51fc87..0ccfb3f9f1c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineAgentInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineAgentInstanceView.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.compute; import java.util.List; + import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -34,7 +35,7 @@ public class VirtualMachineAgentInstanceView { private List statuses; /** - * Get the vmAgentVersion value. + * Get the VM Agent full version. * * @return the vmAgentVersion value */ @@ -43,7 +44,7 @@ public String vmAgentVersion() { } /** - * Set the vmAgentVersion value. + * Set the VM Agent full version. * * @param vmAgentVersion the vmAgentVersion value to set * @return the VirtualMachineAgentInstanceView object itself. @@ -54,7 +55,7 @@ public VirtualMachineAgentInstanceView withVmAgentVersion(String vmAgentVersion) } /** - * Get the extensionHandlers value. + * Get the virtual machine extension handler instance view. * * @return the extensionHandlers value */ @@ -63,7 +64,7 @@ public List extensionHandlers() { } /** - * Set the extensionHandlers value. + * Set the virtual machine extension handler instance view. * * @param extensionHandlers the extensionHandlers value to set * @return the VirtualMachineAgentInstanceView object itself. @@ -74,7 +75,7 @@ public VirtualMachineAgentInstanceView withExtensionHandlers(List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the VirtualMachineAgentInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureParametersInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineCaptureParameters.java similarity index 65% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureParametersInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineCaptureParameters.java index 9dd0891d7cb..c0b8e472a31 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureParametersInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineCaptureParameters.java @@ -6,14 +6,14 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import com.fasterxml.jackson.annotation.JsonProperty; /** * Capture Virtual Machine parameters. */ -public class VirtualMachineCaptureParametersInner { +public class VirtualMachineCaptureParameters { /** * The captured virtual hard disk's name prefix. */ @@ -34,7 +34,7 @@ public class VirtualMachineCaptureParametersInner { private boolean overwriteVhds; /** - * Get the vhdPrefix value. + * Get the captured virtual hard disk's name prefix. * * @return the vhdPrefix value */ @@ -43,18 +43,18 @@ public String vhdPrefix() { } /** - * Set the vhdPrefix value. + * Set the captured virtual hard disk's name prefix. * * @param vhdPrefix the vhdPrefix value to set - * @return the VirtualMachineCaptureParametersInner object itself. + * @return the VirtualMachineCaptureParameters object itself. */ - public VirtualMachineCaptureParametersInner withVhdPrefix(String vhdPrefix) { + public VirtualMachineCaptureParameters withVhdPrefix(String vhdPrefix) { this.vhdPrefix = vhdPrefix; return this; } /** - * Get the destinationContainerName value. + * Get the destination container name. * * @return the destinationContainerName value */ @@ -63,18 +63,18 @@ public String destinationContainerName() { } /** - * Set the destinationContainerName value. + * Set the destination container name. * * @param destinationContainerName the destinationContainerName value to set - * @return the VirtualMachineCaptureParametersInner object itself. + * @return the VirtualMachineCaptureParameters object itself. */ - public VirtualMachineCaptureParametersInner withDestinationContainerName(String destinationContainerName) { + public VirtualMachineCaptureParameters withDestinationContainerName(String destinationContainerName) { this.destinationContainerName = destinationContainerName; return this; } /** - * Get the overwriteVhds value. + * Get specifies whether to overwrite the destination virtual hard disk, in case of conflict. * * @return the overwriteVhds value */ @@ -83,12 +83,12 @@ public boolean overwriteVhds() { } /** - * Set the overwriteVhds value. + * Set specifies whether to overwrite the destination virtual hard disk, in case of conflict. * * @param overwriteVhds the overwriteVhds value to set - * @return the VirtualMachineCaptureParametersInner object itself. + * @return the VirtualMachineCaptureParameters object itself. */ - public VirtualMachineCaptureParametersInner withOverwriteVhds(boolean overwriteVhds) { + public VirtualMachineCaptureParameters withOverwriteVhds(boolean overwriteVhds) { this.overwriteVhds = overwriteVhds; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java index 1623c25193b..d15d863ccc9 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java @@ -34,7 +34,7 @@ public class VirtualMachineExtensionHandlerInstanceView { private InstanceViewStatus status; /** - * Get the type value. + * Get specifies the type of the extension; an example is "CustomScriptExtension". * * @return the type value */ @@ -43,7 +43,7 @@ public String type() { } /** - * Set the type value. + * Set specifies the type of the extension; an example is "CustomScriptExtension". * * @param type the type value to set * @return the VirtualMachineExtensionHandlerInstanceView object itself. @@ -54,7 +54,7 @@ public VirtualMachineExtensionHandlerInstanceView withType(String type) { } /** - * Get the typeHandlerVersion value. + * Get specifies the version of the script handler. * * @return the typeHandlerVersion value */ @@ -63,7 +63,7 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion value. + * Set specifies the version of the script handler. * * @param typeHandlerVersion the typeHandlerVersion value to set * @return the VirtualMachineExtensionHandlerInstanceView object itself. @@ -74,7 +74,7 @@ public VirtualMachineExtensionHandlerInstanceView withTypeHandlerVersion(String } /** - * Get the status value. + * Get the extension handler status. * * @return the status value */ @@ -83,7 +83,7 @@ public InstanceViewStatus status() { } /** - * Set the status value. + * Set the extension handler status. * * @param status the status value to set * @return the VirtualMachineExtensionHandlerInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionInstanceView.java index 74926a3efc6..de464bd08a7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionInstanceView.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.compute; import java.util.List; + import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -47,7 +48,7 @@ public class VirtualMachineExtensionInstanceView { private List statuses; /** - * Get the name value. + * Get the virtual machine extension name. * * @return the name value */ @@ -56,7 +57,7 @@ public String name() { } /** - * Set the name value. + * Set the virtual machine extension name. * * @param name the name value to set * @return the VirtualMachineExtensionInstanceView object itself. @@ -67,7 +68,7 @@ public VirtualMachineExtensionInstanceView withName(String name) { } /** - * Get the type value. + * Get specifies the type of the extension; an example is "CustomScriptExtension". * * @return the type value */ @@ -76,7 +77,7 @@ public String type() { } /** - * Set the type value. + * Set specifies the type of the extension; an example is "CustomScriptExtension". * * @param type the type value to set * @return the VirtualMachineExtensionInstanceView object itself. @@ -87,7 +88,7 @@ public VirtualMachineExtensionInstanceView withType(String type) { } /** - * Get the typeHandlerVersion value. + * Get specifies the version of the script handler. * * @return the typeHandlerVersion value */ @@ -96,7 +97,7 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion value. + * Set specifies the version of the script handler. * * @param typeHandlerVersion the typeHandlerVersion value to set * @return the VirtualMachineExtensionInstanceView object itself. @@ -107,7 +108,7 @@ public VirtualMachineExtensionInstanceView withTypeHandlerVersion(String typeHan } /** - * Get the substatuses value. + * Get the resource status information. * * @return the substatuses value */ @@ -116,7 +117,7 @@ public List substatuses() { } /** - * Set the substatuses value. + * Set the resource status information. * * @param substatuses the substatuses value to set * @return the VirtualMachineExtensionInstanceView object itself. @@ -127,7 +128,7 @@ public VirtualMachineExtensionInstanceView withSubstatuses(List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the VirtualMachineExtensionInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionUpdate.java new file mode 100644 index 00000000000..4b9f6a72cd1 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionUpdate.java @@ -0,0 +1,207 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a Virtual Machine Extension. + */ +@JsonFlatten +public class VirtualMachineExtensionUpdate extends UpdateResource { + /** + * 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 type; + + /** + * 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; + + /** + * 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 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withType(String type) { + this.type = type; + 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate 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 VirtualMachineExtensionUpdate object itself. + */ + public VirtualMachineExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineHealthStatus.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineHealthStatus.java index 9a640f90c1b..896a52569f3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineHealthStatus.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineHealthStatus.java @@ -21,7 +21,7 @@ public class VirtualMachineHealthStatus { private InstanceViewStatus status; /** - * Get the status value. + * Get the health status information for the VM. * * @return the status value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentity.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentity.java index 46608449473..45629e3d243 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentity.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentity.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.compute; -import java.util.List; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -42,14 +42,15 @@ public class VirtualMachineIdentity { /** * The list of user identities associated with the Virtual Machine. The - * user identity references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * user identity dictionary key references will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - @JsonProperty(value = "identityIds") - private List identityIds; + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; /** - * Get the principalId value. + * Get the principal id of virtual machine identity. This property will only be provided for a system assigned identity. * * @return the principalId value */ @@ -58,7 +59,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. * * @return the tenantId value */ @@ -67,7 +68,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. * * @return the type value */ @@ -76,7 +77,7 @@ public ResourceIdentityType type() { } /** - * Set the type value. + * Set the type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. * * @param type the type value to set * @return the VirtualMachineIdentity object itself. @@ -87,22 +88,22 @@ public VirtualMachineIdentity withType(ResourceIdentityType type) { } /** - * Get the identityIds value. + * Get the list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * - * @return the identityIds value + * @return the userAssignedIdentities value */ - public List identityIds() { - return this.identityIds; + public Map userAssignedIdentities() { + return this.userAssignedIdentities; } /** - * Set the identityIds value. + * Set the list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * - * @param identityIds the identityIds value to set + * @param userAssignedIdentities the userAssignedIdentities value to set * @return the VirtualMachineIdentity object itself. */ - public VirtualMachineIdentity withIdentityIds(List identityIds) { - this.identityIds = identityIds; + public VirtualMachineIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentityUserAssignedIdentitiesValue.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 00000000000..4bf1d830810 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VirtualMachineIdentityUserAssignedIdentitiesValue model. + */ +public class VirtualMachineIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineInstanceView.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineInstanceView.java index 1081eedf9b5..1ebd72d7d7e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineInstanceView.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineInstanceView.java @@ -94,7 +94,7 @@ public class VirtualMachineInstanceView { private List statuses; /** - * Get the platformUpdateDomain value. + * Get specifies the update domain of the virtual machine. * * @return the platformUpdateDomain value */ @@ -103,7 +103,7 @@ public Integer platformUpdateDomain() { } /** - * Set the platformUpdateDomain value. + * Set specifies the update domain of the virtual machine. * * @param platformUpdateDomain the platformUpdateDomain value to set * @return the VirtualMachineInstanceView object itself. @@ -114,7 +114,7 @@ public VirtualMachineInstanceView withPlatformUpdateDomain(Integer platformUpdat } /** - * Get the platformFaultDomain value. + * Get specifies the fault domain of the virtual machine. * * @return the platformFaultDomain value */ @@ -123,7 +123,7 @@ public Integer platformFaultDomain() { } /** - * Set the platformFaultDomain value. + * Set specifies the fault domain of the virtual machine. * * @param platformFaultDomain the platformFaultDomain value to set * @return the VirtualMachineInstanceView object itself. @@ -134,7 +134,7 @@ public VirtualMachineInstanceView withPlatformFaultDomain(Integer platformFaultD } /** - * Get the computerName value. + * Get the computer name assigned to the virtual machine. * * @return the computerName value */ @@ -143,7 +143,7 @@ public String computerName() { } /** - * Set the computerName value. + * Set the computer name assigned to the virtual machine. * * @param computerName the computerName value to set * @return the VirtualMachineInstanceView object itself. @@ -154,7 +154,7 @@ public VirtualMachineInstanceView withComputerName(String computerName) { } /** - * Get the osName value. + * Get the Operating System running on the virtual machine. * * @return the osName value */ @@ -163,7 +163,7 @@ public String osName() { } /** - * Set the osName value. + * Set the Operating System running on the virtual machine. * * @param osName the osName value to set * @return the VirtualMachineInstanceView object itself. @@ -174,7 +174,7 @@ public VirtualMachineInstanceView withOsName(String osName) { } /** - * Get the osVersion value. + * Get the version of Operating System running on the virtual machine. * * @return the osVersion value */ @@ -183,7 +183,7 @@ public String osVersion() { } /** - * Set the osVersion value. + * Set the version of Operating System running on the virtual machine. * * @param osVersion the osVersion value to set * @return the VirtualMachineInstanceView object itself. @@ -194,7 +194,7 @@ public VirtualMachineInstanceView withOsVersion(String osVersion) { } /** - * Get the rdpThumbPrint value. + * Get the Remote desktop certificate thumbprint. * * @return the rdpThumbPrint value */ @@ -203,7 +203,7 @@ public String rdpThumbPrint() { } /** - * Set the rdpThumbPrint value. + * Set the Remote desktop certificate thumbprint. * * @param rdpThumbPrint the rdpThumbPrint value to set * @return the VirtualMachineInstanceView object itself. @@ -214,7 +214,7 @@ public VirtualMachineInstanceView withRdpThumbPrint(String rdpThumbPrint) { } /** - * Get the vmAgent value. + * Get the VM Agent running on the virtual machine. * * @return the vmAgent value */ @@ -223,7 +223,7 @@ public VirtualMachineAgentInstanceView vmAgent() { } /** - * Set the vmAgent value. + * Set the VM Agent running on the virtual machine. * * @param vmAgent the vmAgent value to set * @return the VirtualMachineInstanceView object itself. @@ -234,7 +234,7 @@ public VirtualMachineInstanceView withVmAgent(VirtualMachineAgentInstanceView vm } /** - * Get the maintenanceRedeployStatus value. + * Get the Maintenance Operation status on the virtual machine. * * @return the maintenanceRedeployStatus value */ @@ -243,7 +243,7 @@ public MaintenanceRedeployStatus maintenanceRedeployStatus() { } /** - * Set the maintenanceRedeployStatus value. + * Set the Maintenance Operation status on the virtual machine. * * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set * @return the VirtualMachineInstanceView object itself. @@ -254,7 +254,7 @@ public VirtualMachineInstanceView withMaintenanceRedeployStatus(MaintenanceRedep } /** - * Get the disks value. + * Get the virtual machine disk information. * * @return the disks value */ @@ -263,7 +263,7 @@ public List disks() { } /** - * Set the disks value. + * Set the virtual machine disk information. * * @param disks the disks value to set * @return the VirtualMachineInstanceView object itself. @@ -274,7 +274,7 @@ public VirtualMachineInstanceView withDisks(List disks) { } /** - * Get the extensions value. + * Get the extensions information. * * @return the extensions value */ @@ -283,7 +283,7 @@ public List extensions() { } /** - * Set the extensions value. + * Set the extensions information. * * @param extensions the extensions value to set * @return the VirtualMachineInstanceView object itself. @@ -294,7 +294,7 @@ public VirtualMachineInstanceView withExtensions(List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the VirtualMachineInstanceView object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java index 59a39330b95..f50c1d234a9 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java @@ -13,10 +13,12 @@ import com.microsoft.azure.management.compute.implementation.VirtualMachineScaleSetInner; import com.microsoft.azure.management.graphrbac.BuiltInRole; import com.microsoft.azure.management.msi.Identity; +import com.microsoft.azure.management.network.ApplicationSecurityGroup; import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerInboundNatPool; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.Network; +import com.microsoft.azure.management.network.NetworkSecurityGroup; import com.microsoft.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.microsoft.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; @@ -381,6 +383,47 @@ public interface VirtualMachineScaleSet extends @Beta(Beta.SinceVersion.V1_4_0) StorageAccountTypes managedOSDiskStorageAccountType(); + + /** + * @return the public ip configuration of virtual machines in the scale set. + */ + @Beta(Beta.SinceVersion.V1_13_0) + VirtualMachineScaleSetPublicIPAddressConfiguration virtualMachinePublicIpConfig(); + + /** + * @return true if ip forwarding is enabled for the virtual machine scale set. + */ + @Beta(Beta.SinceVersion.V1_13_0) + boolean isIpForwardingEnabled(); + + /** + * @return true if accelerated networking is enabled for the virtual machine scale set. + */ + @Beta(Beta.SinceVersion.V1_13_0) + boolean isAcceleratedNetworkingEnabled(); + + /** + * @return the network security group ARM id. + */ + @Beta(Beta.SinceVersion.V1_13_0) + String networkSecurityGroupId(); + + /** + * @return true if single placement group is enabled for the virtual machine scale set. + */ + @Beta(Beta.SinceVersion.V1_13_0) + boolean isSinglePlacementGroupEnabled(); + + /** + * @return the list of application gateway backend pool associated with the virtual machine scale set. + */ + List applicationGatewayBackendAddressPoolsIds(); + + /** + * @return the list of application security groups associated with the virtual machine scale set. + */ + List applicationSecurityGroupIds(); + /** * The virtual machine scale set stages shared between managed and unmanaged based * virtual machine scale set definitions. @@ -1369,16 +1412,6 @@ interface WithSystemAssignedManagedServiceIdentity { */ @Beta(Beta.SinceVersion.V1_5_0) WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(); - - /** - * Specifies that System Assigned (Local) Managed Service Identity needs to be enabled in the virtual - * machine scale set. - * - * @param tokenPort the port on the virtual machine scale set instance where access token is available - * @return the next stage of the definition - */ - @Beta(Beta.SinceVersion.V1_5_0) - WithSystemAssignedIdentityBasedAccessOrCreate withSystemAssignedManagedServiceIdentity(int tokenPort); } /** @@ -1535,6 +1568,175 @@ interface WithVMPriority { WithCreate withLowPriorityVirtualMachine(VirtualMachineEvictionPolicyTypes policy); } + /** + * The stage of the virtual machine scale set definition allowing to enable public ip + * for vm instances. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithVirtualMachinePublicIp { + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withVirtualMachinePublicIp(); + + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @param leafDomainLabel the domain name label + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withVirtualMachinePublicIp(String leafDomainLabel); + + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @param ipConfig the public ip address configuration + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withVirtualMachinePublicIp(VirtualMachineScaleSetPublicIPAddressConfiguration ipConfig); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure accelerated networking. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithAcceleratedNetworking { + /** + * Specify that accelerated networking should be enabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withAcceleratedNetworking(); + + /** + * Specify that accelerated networking should be disabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withoutAcceleratedNetworking(); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure ip forwarding. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithIpForwarding { + /** + * Specify that ip forwarding should be enabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withIpForwarding(); + + /** + * Specify that ip forwarding should be disabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withoutIpForwarding(); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure network security group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithNetworkSecurityGroup { + /** + * Specifies the network security group for the virtual machine scale set. + * + * @param networkSecurityGroup the network security group to associate + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); + + /** + * Specifies the network security group for the virtual machine scale set. + * + * @param networkSecurityGroupId the network security group to associate + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withExistingNetworkSecurityGroupId(String networkSecurityGroupId); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure single placement group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithSinglePlacementGroup { + /** + * Specify that single placement group should be enabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withSinglePlacementGroup(); + + /** + * Specify that single placement group should be disabled for the virtual machine scale set. + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withoutSinglePlacementGroup(); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure application gateway. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithApplicationGateway { + /** + * Specify that an application gateway backend pool should be associated with virtual machine scale set. + * + * @param backendPoolId an existing backend pool id of the gateway + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withExistingApplicationGatewayBackendPool(String backendPoolId); + } + + /** + * The stage of the virtual machine scale set definition allowing to configure application security group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithApplicationSecurityGroup { + /** + * Specifies that provided application security group should be associated with the virtual machine scale set. + * + * @param applicationSecurityGroup the application security group + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); + + /** + * Specifies that provided application security group should be associated with the virtual machine scale set. + * + * @param applicationSecurityGroupId the application security group id + * + * @return the next stage of the definition + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithCreate withExistingApplicationSecurityGroupId(String applicationSecurityGroupId); + } + /** * The stage of a virtual machine scale set definition containing all the required inputs for the resource * to be created, but also allowing for any other optional settings @@ -1554,6 +1756,13 @@ interface WithCreate extends DefinitionStages.WithUserAssignedManagedServiceIdentity, DefinitionStages.WithBootDiagnostics, DefinitionStages.WithVMPriority, + DefinitionStages.WithVirtualMachinePublicIp, + DefinitionStages.WithAcceleratedNetworking, + DefinitionStages.WithIpForwarding, + DefinitionStages.WithNetworkSecurityGroup, + DefinitionStages.WithSinglePlacementGroup, + DefinitionStages.WithApplicationGateway, + DefinitionStages.WithApplicationSecurityGroup, Resource.DefinitionWithTags { } } @@ -1818,14 +2027,13 @@ interface WithSystemAssignedManagedServiceIdentity { WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedManagedServiceIdentity(); /** - * Specifies that System assigned (Local) Managed Service Identity needs to be enabled in the + * Specifies that System assigned (Local) Managed Service Identity needs to be disabled in the * virtual machine scale set. * - * @param tokenPort the port on the virtual machine scale set instance where access token is available * @return the next stage of the update */ - @Beta(Beta.SinceVersion.V1_5_0) - WithSystemAssignedIdentityBasedAccessOrApply withSystemAssignedManagedServiceIdentity(int tokenPort); + @Beta(Beta.SinceVersion.V1_13_0) + WithSystemAssignedIdentityBasedAccessOrApply withoutSystemAssignedManagedServiceIdentity(); } /** @@ -2068,6 +2276,204 @@ interface WithAvailabilityZone { WithApply withAvailabilityZone(AvailabilityZoneId zoneId); } + /** + * The stage of the virtual machine scale set update allowing to enable public ip + * for vm instances. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithVirtualMachinePublicIp { + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withVirtualMachinePublicIp(); + + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @param leafDomainLabel the domain name label + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withVirtualMachinePublicIp(String leafDomainLabel); + + /** + * Specify that virtual machines in the scale set should have public ip address. + * + * @param ipConfig the public ip address configuration + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withVirtualMachinePublicIp(VirtualMachineScaleSetPublicIPAddressConfiguration ipConfig); + } + + /** + * The stage of the virtual machine scale set update allowing to configure accelerated networking. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithAcceleratedNetworking { + /** + * Specify that accelerated networking should be enabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withAcceleratedNetworking(); + + /** + * Specify that accelerated networking should be disabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutAcceleratedNetworking(); + } + + /** + * The stage of the virtual machine scale set update allowing to configure ip forwarding. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithIpForwarding { + /** + * Specify that ip forwarding should be enabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withIpForwarding(); + + /** + * Specify that ip forwarding should be disabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutIpForwarding(); + } + + /** + * The stage of the virtual machine scale set update allowing to configure network security group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithNetworkSecurityGroup { + /** + * Specifies the network security group for the virtual machine scale set. + * + * @param networkSecurityGroup the network security group to associate + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup); + + /** + * Specifies the network security group for the virtual machine scale set. + * + * @param networkSecurityGroupId the network security group to associate + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withExistingNetworkSecurityGroupId(String networkSecurityGroupId); + + /** + * Specifies that network security group association should be removed if exists. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutNetworkSecurityGroup(); + } + + /** + * The stage of the virtual machine scale set update allowing to configure single placement group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithSinglePlacementGroup { + /** + * Specify that single placement group should be enabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withSinglePlacementGroup(); + + /** + * Specify that single placement group should be disabled for the virtual machine scale set. + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutSinglePlacementGroup(); + } + + /** + * The stage of the virtual machine scale set update allowing to configure application gateway. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithApplicationGateway { + /** + * Specify that an application gateway backend pool should be associated with virtual machine scale set. + * + * @param backendPoolId an existing backend pool id of the gateway + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withExistingApplicationGatewayBackendPool(String backendPoolId); + + /** + * Specify an existing application gateway associated should be removed from the virtual machine scale set. + * + * @param backendPoolId an existing backend pool id of the gateway + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutApplicationGatewayBackendPool(String backendPoolId); + } + + /** + * The stage of the virtual machine scale set update allowing to configure application security group. + */ + @Beta(Beta.SinceVersion.V1_13_0) + interface WithApplicationSecurityGroup { + /** + * Specifies that provided application security group should be associated with the virtual machine scale set. + * + * @param applicationSecurityGroup the application security group + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup); + + /** + * Specifies that provided application security group should be associated with the virtual machine scale set. + * + * @param applicationSecurityGroupId the application security group id + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withExistingApplicationSecurityGroupId(String applicationSecurityGroupId); + + /** + * Specifies that provided application security group should be removed from the virtual machine scale set. + * + * @param applicationSecurityGroupId the application security group id + * + * @return the next stage of the update + */ + @Beta(Beta.SinceVersion.V1_13_0) + WithApply withoutApplicationSecurityGroup(String applicationSecurityGroupId); + + } + /** * The stage of a virtual machine scale set update containing inputs for the resource to be updated. */ @@ -2085,7 +2491,14 @@ interface WithApply extends UpdateStages.WithSystemAssignedManagedServiceIdentity, UpdateStages.WithUserAssignedManagedServiceIdentity, UpdateStages.WithBootDiagnostics, - UpdateStages.WithAvailabilityZone { + UpdateStages.WithAvailabilityZone, + UpdateStages.WithVirtualMachinePublicIp, + UpdateStages.WithAcceleratedNetworking, + UpdateStages.WithIpForwarding, + UpdateStages.WithNetworkSecurityGroup, + UpdateStages.WithSinglePlacementGroup, + UpdateStages.WithApplicationGateway, + UpdateStages.WithApplicationSecurityGroup { } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetDataDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetDataDisk.java index a4d5b44bb52..6ec8dde1e6b 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetDataDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetDataDisk.java @@ -67,7 +67,7 @@ public class VirtualMachineScaleSetDataDisk { private VirtualMachineScaleSetManagedDiskParameters managedDisk; /** - * Get the name value. + * Get the disk name. * * @return the name value */ @@ -76,7 +76,7 @@ public String name() { } /** - * Set the name value. + * Set the disk name. * * @param name the name value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -87,7 +87,7 @@ public VirtualMachineScaleSetDataDisk withName(String name) { } /** - * Get the lun value. + * Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @return the lun value */ @@ -96,7 +96,7 @@ public int lun() { } /** - * Set the lun value. + * Set specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. * * @param lun the lun value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -107,7 +107,7 @@ public VirtualMachineScaleSetDataDisk withLun(int lun) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -116,7 +116,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -127,7 +127,7 @@ public VirtualMachineScaleSetDataDisk withCaching(CachingTypes caching) { } /** - * Get the writeAcceleratorEnabled value. + * Get specifies whether writeAccelerator should be enabled or disabled on the disk. * * @return the writeAcceleratorEnabled value */ @@ -136,7 +136,7 @@ public Boolean writeAcceleratorEnabled() { } /** - * Set the writeAcceleratorEnabled value. + * Set specifies whether writeAccelerator should be enabled or disabled on the disk. * * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -147,7 +147,7 @@ public VirtualMachineScaleSetDataDisk withWriteAcceleratorEnabled(Boolean writeA } /** - * Get the createOption value. + * Get the create option. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @return the createOption value */ @@ -156,7 +156,7 @@ public DiskCreateOptionTypes createOption() { } /** - * Set the createOption value. + * Set the create option. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @param createOption the createOption value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -167,7 +167,7 @@ public VirtualMachineScaleSetDataDisk withCreateOption(DiskCreateOptionTypes cre } /** - * Get the diskSizeGB value. + * Get specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @return the diskSizeGB value */ @@ -176,7 +176,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB. * * @param diskSizeGB the diskSizeGB value to set * @return the VirtualMachineScaleSetDataDisk object itself. @@ -187,7 +187,7 @@ public VirtualMachineScaleSetDataDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the managedDisk value. + * Get the managed disk parameters. * * @return the managedDisk value */ @@ -196,7 +196,7 @@ public VirtualMachineScaleSetManagedDiskParameters managedDisk() { } /** - * Set the managedDisk value. + * Set the managed disk parameters. * * @param managedDisk the managedDisk value to set * @return the VirtualMachineScaleSetDataDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java index 8eef3206af5..8282c3594ce 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java @@ -23,7 +23,7 @@ public class VirtualMachineScaleSetExtensionProfile { private List extensions; /** - * Get the extensions value. + * Get the virtual machine scale set child extension resources. * * @return the extensions value */ @@ -32,7 +32,7 @@ public List extensions() { } /** - * Set the extensions value. + * Set the virtual machine scale set child extension resources. * * @param extensions the extensions value to set * @return the VirtualMachineScaleSetExtensionProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetIPConfigurationInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIPConfiguration.java similarity index 52% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetIPConfigurationInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIPConfiguration.java index 22b180d47f1..634c419def4 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetIPConfigurationInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIPConfiguration.java @@ -6,11 +6,8 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.ApiEntityReference; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetPublicIPAddressConfiguration; -import com.microsoft.azure.management.compute.IPVersion; import java.util.List; import com.microsoft.azure.SubResource; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,7 +17,7 @@ * Describes a virtual machine scale set network profile's IP configuration. */ @JsonFlatten -public class VirtualMachineScaleSetIPConfigurationInner extends SubResource { +public class VirtualMachineScaleSetIPConfiguration extends SubResource { /** * The IP configuration name. */ @@ -61,7 +58,7 @@ public class VirtualMachineScaleSetIPConfigurationInner extends SubResource { * application gateways. Multiple scale sets cannot use the same * application gateway. */ - @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + @JsonProperty(value = "properties.applicationGatewayBackendAddressPoolsIds") private List applicationGatewayBackendAddressPools; /** @@ -83,7 +80,13 @@ public class VirtualMachineScaleSetIPConfigurationInner extends SubResource { private List loadBalancerInboundNatPools; /** - * Get the name value. + * Gets the applicationSecurityGroups. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * Get the IP configuration name. * * @return the name value */ @@ -92,18 +95,18 @@ public String name() { } /** - * Set the name value. + * Set the IP configuration name. * * @param name the name value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withName(String name) { + public VirtualMachineScaleSetIPConfiguration withName(String name) { this.name = name; return this; } /** - * Get the subnet value. + * Get specifies the identifier of the subnet. * * @return the subnet value */ @@ -112,18 +115,18 @@ public ApiEntityReference subnet() { } /** - * Set the subnet value. + * Set specifies the identifier of the subnet. * * @param subnet the subnet value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withSubnet(ApiEntityReference subnet) { + public VirtualMachineScaleSetIPConfiguration withSubnet(ApiEntityReference subnet) { this.subnet = subnet; return this; } /** - * Get the primary value. + * Get specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @return the primary value */ @@ -132,18 +135,18 @@ public Boolean primary() { } /** - * Set the primary value. + * Set specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @param primary the primary value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withPrimary(Boolean primary) { + public VirtualMachineScaleSetIPConfiguration withPrimary(Boolean primary) { this.primary = primary; return this; } /** - * Get the publicIPAddressConfiguration value. + * Get the publicIPAddressConfiguration. * * @return the publicIPAddressConfiguration value */ @@ -152,18 +155,18 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfigu } /** - * Set the publicIPAddressConfiguration value. + * Set the publicIPAddressConfiguration. * * @param publicIPAddressConfiguration the publicIPAddressConfiguration value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withPublicIPAddressConfiguration(VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration) { + public VirtualMachineScaleSetIPConfiguration withPublicIPAddressConfiguration(VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration) { this.publicIPAddressConfiguration = publicIPAddressConfiguration; return this; } /** - * Get the privateIPAddressVersion value. + * Get available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. * * @return the privateIPAddressVersion value */ @@ -172,38 +175,38 @@ public IPVersion privateIPAddressVersion() { } /** - * Set the privateIPAddressVersion value. + * Set available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. * * @param privateIPAddressVersion the privateIPAddressVersion value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + public VirtualMachineScaleSetIPConfiguration withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { this.privateIPAddressVersion = privateIPAddressVersion; return this; } /** - * Get the applicationGatewayBackendAddressPools value. + * Get specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. * - * @return the applicationGatewayBackendAddressPools value + * @return the applicationGatewayBackendAddressPoolsIds value */ public List applicationGatewayBackendAddressPools() { return this.applicationGatewayBackendAddressPools; } /** - * Set the applicationGatewayBackendAddressPools value. + * Set specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPoolsIds value to set + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + public VirtualMachineScaleSetIPConfiguration withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; return this; } /** - * Get the loadBalancerBackendAddressPools value. + * Get specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. * * @return the loadBalancerBackendAddressPools value */ @@ -212,18 +215,18 @@ public List loadBalancerBackendAddressPools() { } /** - * Set the loadBalancerBackendAddressPools value. + * Set specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. * * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + public VirtualMachineScaleSetIPConfiguration withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; return this; } /** - * Get the loadBalancerInboundNatPools value. + * Get specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. * * @return the loadBalancerInboundNatPools value */ @@ -232,14 +235,33 @@ public List loadBalancerInboundNatPools() { } /** - * Set the loadBalancerInboundNatPools value. + * Set specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. * * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set - * @return the VirtualMachineScaleSetIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetIPConfiguration object itself. */ - public VirtualMachineScaleSetIPConfigurationInner withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { + public VirtualMachineScaleSetIPConfiguration withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; return this; } + /** + * Get application security groups. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups. + * + * @param applicationSecurityGroups application security groups + * @return the VirtualMachineScaleSetIPConfiguration object itself. + */ + public VirtualMachineScaleSetIPConfiguration withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentity.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentity.java index 1c058e7416b..02dc62bc44b 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentity.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentity.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.compute; -import java.util.List; +import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -42,14 +42,15 @@ public class VirtualMachineScaleSetIdentity { /** * The list of user identities associated with the virtual machine scale - * set. The user identity references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'. + * set. The user identity dictionary key references will be ARM resource + * ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - @JsonProperty(value = "identityIds") - private List identityIds; + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; /** - * Get the principalId value. + * Get the principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. * * @return the principalId value */ @@ -58,7 +59,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. * * @return the tenantId value */ @@ -67,7 +68,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. * * @return the type value */ @@ -76,7 +77,7 @@ public ResourceIdentityType type() { } /** - * Set the type value. + * Set the type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. * * @param type the type value to set * @return the VirtualMachineScaleSetIdentity object itself. @@ -87,22 +88,22 @@ public VirtualMachineScaleSetIdentity withType(ResourceIdentityType type) { } /** - * Get the identityIds value. + * Get the list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * - * @return the identityIds value + * @return the userAssignedIdentities value */ - public List identityIds() { - return this.identityIds; + public Map userAssignedIdentities() { + return this.userAssignedIdentities; } /** - * Set the identityIds value. + * Set the list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. * - * @param identityIds the identityIds value to set + * @param userAssignedIdentities the userAssignedIdentities value to set * @return the VirtualMachineScaleSetIdentity object itself. */ - public VirtualMachineScaleSetIdentity withIdentityIds(List identityIds) { - this.identityIds = identityIds; + public VirtualMachineScaleSetIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 00000000000..f78278e3d3b --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue model. + */ +public class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java index 3277a519652..ca07cc5bf1e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java @@ -23,7 +23,7 @@ public class VirtualMachineScaleSetInstanceViewStatusesSummary { private List statusesSummary; /** - * Get the statusesSummary value. + * Get the extensions information. * * @return the statusesSummary value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIpTag.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIpTag.java new file mode 100644 index 00000000000..c6f43e1bee4 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetIpTag.java @@ -0,0 +1,69 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IP tag associated with the public IP address. + */ +public class VirtualMachineScaleSetIpTag { + /** + * IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /** + * IP tag associated with the public IP. Example: SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get iP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set iP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get iP tag associated with the public IP. Example: SQL, Storage etc. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set iP tag associated with the public IP. Example: SQL, Storage etc. + * + * @param tag the tag value to set + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java index 5bf72ce6af2..944820d6050 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java @@ -23,7 +23,7 @@ public class VirtualMachineScaleSetManagedDiskParameters { private StorageAccountTypes storageAccountType; /** - * Get the storageAccountType value. + * Get specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @return the storageAccountType value */ @@ -32,7 +32,7 @@ public StorageAccountTypes storageAccountType() { } /** - * Set the storageAccountType value. + * Set specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'. * * @param storageAccountType the storageAccountType value to set * @return the VirtualMachineScaleSetManagedDiskParameters object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetNetworkConfigurationInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java similarity index 60% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetNetworkConfigurationInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java index 3c9b28a3014..c60f3087d5c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetNetworkConfigurationInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java @@ -6,10 +6,9 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import com.microsoft.azure.SubResource; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkConfigurationDnsSettings; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -19,7 +18,7 @@ * configurations. */ @JsonFlatten -public class VirtualMachineScaleSetNetworkConfigurationInner extends SubResource { +public class VirtualMachineScaleSetNetworkConfiguration extends SubResource { /** * The network configuration name. */ @@ -56,7 +55,7 @@ public class VirtualMachineScaleSetNetworkConfigurationInner extends SubResource * Specifies the IP configurations of the network interface. */ @JsonProperty(value = "properties.ipConfigurations", required = true) - private List ipConfigurations; + private List ipConfigurations; /** * Whether IP forwarding enabled on this NIC. @@ -65,7 +64,7 @@ public class VirtualMachineScaleSetNetworkConfigurationInner extends SubResource private Boolean enableIPForwarding; /** - * Get the name value. + * Get the network configuration name. * * @return the name value */ @@ -74,18 +73,18 @@ public String name() { } /** - * Set the name value. + * Set the network configuration name. * * @param name the name value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withName(String name) { + public VirtualMachineScaleSetNetworkConfiguration withName(String name) { this.name = name; return this; } /** - * Get the primary value. + * Get specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @return the primary value */ @@ -94,18 +93,18 @@ public Boolean primary() { } /** - * Set the primary value. + * Set specifies the primary network interface in case the virtual machine has more than 1 network interface. * * @param primary the primary value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withPrimary(Boolean primary) { + public VirtualMachineScaleSetNetworkConfiguration withPrimary(Boolean primary) { this.primary = primary; return this; } /** - * Get the enableAcceleratedNetworking value. + * Get specifies whether the network interface is accelerated networking-enabled. * * @return the enableAcceleratedNetworking value */ @@ -114,18 +113,18 @@ public Boolean enableAcceleratedNetworking() { } /** - * Set the enableAcceleratedNetworking value. + * Set specifies whether the network interface is accelerated networking-enabled. * * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + public VirtualMachineScaleSetNetworkConfiguration withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { this.enableAcceleratedNetworking = enableAcceleratedNetworking; return this; } /** - * Get the networkSecurityGroup value. + * Get the network security group. * * @return the networkSecurityGroup value */ @@ -134,18 +133,18 @@ public SubResource networkSecurityGroup() { } /** - * Set the networkSecurityGroup value. + * Set the network security group. * * @param networkSecurityGroup the networkSecurityGroup value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withNetworkSecurityGroup(SubResource networkSecurityGroup) { + public VirtualMachineScaleSetNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { this.networkSecurityGroup = networkSecurityGroup; return this; } /** - * Get the dnsSettings value. + * Get the dns settings to be applied on the network interfaces. * * @return the dnsSettings value */ @@ -154,38 +153,38 @@ public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { } /** - * Set the dnsSettings value. + * Set the dns settings to be applied on the network interfaces. * * @param dnsSettings the dnsSettings value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + public VirtualMachineScaleSetNetworkConfiguration withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { this.dnsSettings = dnsSettings; return this; } /** - * Get the ipConfigurations value. + * Get specifies the IP configurations of the network interface. * * @return the ipConfigurations value */ - public List ipConfigurations() { + public List ipConfigurations() { return this.ipConfigurations; } /** - * Set the ipConfigurations value. + * Set specifies the IP configurations of the network interface. * * @param ipConfigurations the ipConfigurations value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withIpConfigurations(List ipConfigurations) { + public VirtualMachineScaleSetNetworkConfiguration withIpConfigurations(List ipConfigurations) { this.ipConfigurations = ipConfigurations; return this; } /** - * Get the enableIPForwarding value. + * Get whether IP forwarding enabled on this NIC. * * @return the enableIPForwarding value */ @@ -194,12 +193,12 @@ public Boolean enableIPForwarding() { } /** - * Set the enableIPForwarding value. + * Set whether IP forwarding enabled on this NIC. * * @param enableIPForwarding the enableIPForwarding value to set - * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. */ - public VirtualMachineScaleSetNetworkConfigurationInner withEnableIPForwarding(Boolean enableIPForwarding) { + public VirtualMachineScaleSetNetworkConfiguration withEnableIPForwarding(Boolean enableIPForwarding) { this.enableIPForwarding = enableIPForwarding; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java index 3e1f067a16d..2640c7de4be 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java @@ -23,7 +23,7 @@ public class VirtualMachineScaleSetNetworkConfigurationDnsSettings { private List dnsServers; /** - * Get the dnsServers value. + * Get list of DNS servers IP addresses. * * @return the dnsServers value */ @@ -32,7 +32,7 @@ public List dnsServers() { } /** - * Set the dnsServers value. + * Set list of DNS servers IP addresses. * * @param dnsServers the dnsServers value to set * @return the VirtualMachineScaleSetNetworkConfigurationDnsSettings object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java index 605bdde500d..d825f0c3eaf 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.compute; import java.util.List; -import com.microsoft.azure.management.compute.implementation.VirtualMachineScaleSetNetworkConfigurationInner; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -29,10 +28,10 @@ public class VirtualMachineScaleSetNetworkProfile { * The list of network configurations. */ @JsonProperty(value = "networkInterfaceConfigurations") - private List networkInterfaceConfigurations; + private List networkInterfaceConfigurations; /** - * Get the healthProbe value. + * Get a reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. * * @return the healthProbe value */ @@ -41,7 +40,7 @@ public ApiEntityReference healthProbe() { } /** - * Set the healthProbe value. + * Set a reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. * * @param healthProbe the healthProbe value to set * @return the VirtualMachineScaleSetNetworkProfile object itself. @@ -52,21 +51,21 @@ public VirtualMachineScaleSetNetworkProfile withHealthProbe(ApiEntityReference h } /** - * Get the networkInterfaceConfigurations value. + * Get the list of network configurations. * * @return the networkInterfaceConfigurations value */ - public List networkInterfaceConfigurations() { + public List networkInterfaceConfigurations() { return this.networkInterfaceConfigurations; } /** - * Set the networkInterfaceConfigurations value. + * Set the list of network configurations. * * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set * @return the VirtualMachineScaleSetNetworkProfile object itself. */ - public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations(List networkInterfaceConfigurations) { + public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations(List networkInterfaceConfigurations) { this.networkInterfaceConfigurations = networkInterfaceConfigurations; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSDisk.java index 34b6840c803..8671922827d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSDisk.java @@ -81,7 +81,7 @@ public class VirtualMachineScaleSetOSDisk { private VirtualMachineScaleSetManagedDiskParameters managedDisk; /** - * Get the name value. + * Get the disk name. * * @return the name value */ @@ -90,7 +90,7 @@ public String name() { } /** - * Set the name value. + * Set the disk name. * * @param name the name value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -101,7 +101,7 @@ public VirtualMachineScaleSetOSDisk withName(String name) { } /** - * Get the caching value. + * Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -110,7 +110,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -121,7 +121,7 @@ public VirtualMachineScaleSetOSDisk withCaching(CachingTypes caching) { } /** - * Get the writeAcceleratorEnabled value. + * Get specifies whether writeAccelerator should be enabled or disabled on the disk. * * @return the writeAcceleratorEnabled value */ @@ -130,7 +130,7 @@ public Boolean writeAcceleratorEnabled() { } /** - * Set the writeAcceleratorEnabled value. + * Set specifies whether writeAccelerator should be enabled or disabled on the disk. * * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -141,7 +141,7 @@ public VirtualMachineScaleSetOSDisk withWriteAcceleratorEnabled(Boolean writeAcc } /** - * Get the createOption value. + * Get specifies how the virtual machines in the scale set should be created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @return the createOption value */ @@ -150,7 +150,7 @@ public DiskCreateOptionTypes createOption() { } /** - * Set the createOption value. + * Set specifies how the virtual machines in the scale set should be created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'. * * @param createOption the createOption value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -161,7 +161,7 @@ public VirtualMachineScaleSetOSDisk withCreateOption(DiskCreateOptionTypes creat } /** - * Get the osType value. + * Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -170,7 +170,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -181,7 +181,7 @@ public VirtualMachineScaleSetOSDisk withOsType(OperatingSystemTypes osType) { } /** - * Get the image value. + * Get specifies information about the unmanaged user image to base the scale set on. * * @return the image value */ @@ -190,7 +190,7 @@ public VirtualHardDisk image() { } /** - * Set the image value. + * Set specifies information about the unmanaged user image to base the scale set on. * * @param image the image value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -201,7 +201,7 @@ public VirtualMachineScaleSetOSDisk withImage(VirtualHardDisk image) { } /** - * Get the vhdContainers value. + * Get specifies the container urls that are used to store operating system disks for the scale set. * * @return the vhdContainers value */ @@ -210,7 +210,7 @@ public List vhdContainers() { } /** - * Set the vhdContainers value. + * Set specifies the container urls that are used to store operating system disks for the scale set. * * @param vhdContainers the vhdContainers value to set * @return the VirtualMachineScaleSetOSDisk object itself. @@ -221,7 +221,7 @@ public VirtualMachineScaleSetOSDisk withVhdContainers(List vhdContainers } /** - * Get the managedDisk value. + * Get the managed disk parameters. * * @return the managedDisk value */ @@ -230,7 +230,7 @@ public VirtualMachineScaleSetManagedDiskParameters managedDisk() { } /** - * Set the managedDisk value. + * Set the managed disk parameters. * * @param managedDisk the managedDisk value to set * @return the VirtualMachineScaleSetOSDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSProfile.java index 65447a0db40..89534cd297b 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOSProfile.java @@ -102,7 +102,7 @@ public class VirtualMachineScaleSetOSProfile { private List secrets; /** - * Get the computerNamePrefix value. + * Get specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. * * @return the computerNamePrefix value */ @@ -111,7 +111,7 @@ public String computerNamePrefix() { } /** - * Set the computerNamePrefix value. + * Set specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. * * @param computerNamePrefix the computerNamePrefix value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -122,7 +122,7 @@ public VirtualMachineScaleSetOSProfile withComputerNamePrefix(String computerNam } /** - * Get the adminUsername value. + * Get specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the adminUsername value */ @@ -131,7 +131,7 @@ public String adminUsername() { } /** - * Set the adminUsername value. + * Set specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param adminUsername the adminUsername value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -142,7 +142,7 @@ public VirtualMachineScaleSetOSProfile withAdminUsername(String adminUsername) { } /** - * Get the adminPassword value. + * Get specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). * * @return the adminPassword value */ @@ -151,7 +151,7 @@ public String adminPassword() { } /** - * Set the adminPassword value. + * Set specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password). * * @param adminPassword the adminPassword value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -162,7 +162,7 @@ public VirtualMachineScaleSetOSProfile withAdminPassword(String adminPassword) { } /** - * Get the customData value. + * Get specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the customData value */ @@ -171,7 +171,7 @@ public String customData() { } /** - * Set the customData value. + * Set specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param customData the customData value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -182,7 +182,7 @@ public VirtualMachineScaleSetOSProfile withCustomData(String customData) { } /** - * Get the windowsConfiguration value. + * Get specifies Windows operating system settings on the virtual machine. * * @return the windowsConfiguration value */ @@ -191,7 +191,7 @@ public WindowsConfiguration windowsConfiguration() { } /** - * Set the windowsConfiguration value. + * Set specifies Windows operating system settings on the virtual machine. * * @param windowsConfiguration the windowsConfiguration value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -202,7 +202,7 @@ public VirtualMachineScaleSetOSProfile withWindowsConfiguration(WindowsConfigura } /** - * Get the linuxConfiguration value. + * Get specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @return the linuxConfiguration value */ @@ -211,7 +211,7 @@ public LinuxConfiguration linuxConfiguration() { } /** - * Set the linuxConfiguration value. + * Set specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). * * @param linuxConfiguration the linuxConfiguration value to set * @return the VirtualMachineScaleSetOSProfile object itself. @@ -222,7 +222,7 @@ public VirtualMachineScaleSetOSProfile withLinuxConfiguration(LinuxConfiguration } /** - * Get the secrets value. + * Get specifies set of certificates that should be installed onto the virtual machines in the scale set. * * @return the secrets value */ @@ -231,7 +231,7 @@ public List secrets() { } /** - * Set the secrets value. + * Set specifies set of certificates that should be installed onto the virtual machines in the scale set. * * @param secrets the secrets value to set * @return the VirtualMachineScaleSetOSProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfiguration.java index 43f88625137..2ee501a8e8a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfiguration.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.compute; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -36,7 +37,13 @@ public class VirtualMachineScaleSetPublicIPAddressConfiguration { private VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings; /** - * Get the name value. + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "properties.ipTags") + private List ipTags; + + /** + * Get the publicIP address configuration name. * * @return the name value */ @@ -45,7 +52,7 @@ public String name() { } /** - * Set the name value. + * Set the publicIP address configuration name. * * @param name the name value to set * @return the VirtualMachineScaleSetPublicIPAddressConfiguration object itself. @@ -56,7 +63,7 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration withName(String name) } /** - * Get the idleTimeoutInMinutes value. + * Get the idle timeout of the public IP address. * * @return the idleTimeoutInMinutes value */ @@ -65,7 +72,7 @@ public Integer idleTimeoutInMinutes() { } /** - * Set the idleTimeoutInMinutes value. + * Set the idle timeout of the public IP address. * * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set * @return the VirtualMachineScaleSetPublicIPAddressConfiguration object itself. @@ -76,7 +83,7 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration withIdleTimeoutInMinut } /** - * Get the dnsSettings value. + * Get the dns settings to be applied on the publicIP addresses . * * @return the dnsSettings value */ @@ -85,7 +92,7 @@ public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings } /** - * Set the dnsSettings value. + * Set the dns settings to be applied on the publicIP addresses . * * @param dnsSettings the dnsSettings value to set * @return the VirtualMachineScaleSetPublicIPAddressConfiguration object itself. @@ -95,4 +102,24 @@ public VirtualMachineScaleSetPublicIPAddressConfiguration withDnsSettings(Virtua return this; } + /** + * Get the list of IP tags associated with the public IP address. + * + * @return the ipTags value + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set + * @return the VirtualMachineScaleSetPublicIPAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIPAddressConfiguration withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.java index 20785ffacdd..f08b14280c1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.java @@ -24,7 +24,7 @@ public class VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { private String domainNameLabel; /** - * Get the domainNameLabel value. + * Get the Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created. * * @return the domainNameLabel value */ @@ -33,7 +33,7 @@ public String domainNameLabel() { } /** - * Set the domainNameLabel value. + * Set the Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created. * * @param domainNameLabel the domainNameLabel value to set * @return the VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java index 21418d2c4c4..5c56f3024f5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java @@ -40,7 +40,7 @@ public class VirtualMachineScaleSetSkuCapacity { private VirtualMachineScaleSetSkuScaleType scaleType; /** - * Get the minimum value. + * Get the minimum capacity. * * @return the minimum value */ @@ -49,7 +49,7 @@ public Long minimum() { } /** - * Get the maximum value. + * Get the maximum capacity that can be set. * * @return the maximum value */ @@ -58,7 +58,7 @@ public Long maximum() { } /** - * Get the defaultCapacity value. + * Get the default capacity. * * @return the defaultCapacity value */ @@ -67,7 +67,7 @@ public Long defaultCapacity() { } /** - * Get the scaleType value. + * Get the scale type applicable to the sku. Possible values include: 'Automatic', 'None'. * * @return the scaleType value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetStorageProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetStorageProfile.java index 70ea86fb48b..ed383cbc760 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetStorageProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetStorageProfile.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.implementation.ImageReferenceInner; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; @@ -24,7 +23,7 @@ public class VirtualMachineScaleSetStorageProfile { * other creation operations. */ @JsonProperty(value = "imageReference") - private ImageReferenceInner imageReference; + private ImageReference imageReference; /** * Specifies information about the operating system disk used by the @@ -45,27 +44,27 @@ public class VirtualMachineScaleSetStorageProfile { private List dataDisks; /** - * Get the imageReference value. + * Get specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. * * @return the imageReference value */ - public ImageReferenceInner imageReference() { + public ImageReference imageReference() { return this.imageReference; } /** - * Set the imageReference value. + * Set specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. * * @param imageReference the imageReference value to set * @return the VirtualMachineScaleSetStorageProfile object itself. */ - public VirtualMachineScaleSetStorageProfile withImageReference(ImageReferenceInner imageReference) { + public VirtualMachineScaleSetStorageProfile withImageReference(ImageReference imageReference) { this.imageReference = imageReference; return this; } /** - * Get the osDisk value. + * Get specifies information about the operating system disk used by the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the osDisk value */ @@ -74,7 +73,7 @@ public VirtualMachineScaleSetOSDisk osDisk() { } /** - * Set the osDisk value. + * Set specifies information about the operating system disk used by the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param osDisk the osDisk value to set * @return the VirtualMachineScaleSetStorageProfile object itself. @@ -85,7 +84,7 @@ public VirtualMachineScaleSetStorageProfile withOsDisk(VirtualMachineScaleSetOSD } /** - * Get the dataDisks value. + * Get specifies the parameters that are used to add data disks to the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @return the dataDisks value */ @@ -94,7 +93,7 @@ public List dataDisks() { } /** - * Set the dataDisks value. + * Set specifies the parameters that are used to add data disks to the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). * * @param dataDisks the dataDisks value to set * @return the VirtualMachineScaleSetStorageProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdate.java similarity index 63% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdate.java index 8666c0c1318..883e35c5229 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdate.java @@ -6,22 +6,16 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.Sku; -import com.microsoft.azure.management.compute.Plan; -import com.microsoft.azure.management.compute.UpgradePolicy; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateVMProfile; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.management.compute.UpdateResource; /** * Describes a Virtual Machine Scale Set. */ @JsonFlatten -public class VirtualMachineScaleSetUpdateInner extends UpdateResource { +public class VirtualMachineScaleSetUpdate extends UpdateResource { /** * The virtual machine scale set sku. */ @@ -68,7 +62,7 @@ public class VirtualMachineScaleSetUpdateInner extends UpdateResource { private VirtualMachineScaleSetIdentity identity; /** - * Get the sku value. + * Get the virtual machine scale set sku. * * @return the sku value */ @@ -77,18 +71,18 @@ public Sku sku() { } /** - * Set the sku value. + * Set the virtual machine scale set sku. * * @param sku the sku value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withSku(Sku sku) { + public VirtualMachineScaleSetUpdate withSku(Sku sku) { this.sku = sku; return this; } /** - * Get the plan value. + * Get the purchase plan when deploying a virtual machine scale set from VM Marketplace images. * * @return the plan value */ @@ -97,18 +91,18 @@ public Plan plan() { } /** - * Set the plan value. + * Set the purchase plan when deploying a virtual machine scale set from VM Marketplace images. * * @param plan the plan value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withPlan(Plan plan) { + public VirtualMachineScaleSetUpdate withPlan(Plan plan) { this.plan = plan; return this; } /** - * Get the upgradePolicy value. + * Get the upgrade policy. * * @return the upgradePolicy value */ @@ -117,18 +111,18 @@ public UpgradePolicy upgradePolicy() { } /** - * Set the upgradePolicy value. + * Set the upgrade policy. * * @param upgradePolicy the upgradePolicy value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withUpgradePolicy(UpgradePolicy upgradePolicy) { + public VirtualMachineScaleSetUpdate withUpgradePolicy(UpgradePolicy upgradePolicy) { this.upgradePolicy = upgradePolicy; return this; } /** - * Get the virtualMachineProfile value. + * Get the virtual machine profile. * * @return the virtualMachineProfile value */ @@ -137,18 +131,18 @@ public VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile() { } /** - * Set the virtualMachineProfile value. + * Set the virtual machine profile. * * @param virtualMachineProfile the virtualMachineProfile value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withVirtualMachineProfile(VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { + public VirtualMachineScaleSetUpdate withVirtualMachineProfile(VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile) { this.virtualMachineProfile = virtualMachineProfile; return this; } /** - * Get the overprovision value. + * Get specifies whether the Virtual Machine Scale Set should be overprovisioned. * * @return the overprovision value */ @@ -157,18 +151,18 @@ public Boolean overprovision() { } /** - * Set the overprovision value. + * Set specifies whether the Virtual Machine Scale Set should be overprovisioned. * * @param overprovision the overprovision value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withOverprovision(Boolean overprovision) { + public VirtualMachineScaleSetUpdate withOverprovision(Boolean overprovision) { this.overprovision = overprovision; return this; } /** - * Get the singlePlacementGroup value. + * Get when true this limits the scale set to a single placement group, of max size 100 virtual machines. * * @return the singlePlacementGroup value */ @@ -177,18 +171,18 @@ public Boolean singlePlacementGroup() { } /** - * Set the singlePlacementGroup value. + * Set when true this limits the scale set to a single placement group, of max size 100 virtual machines. * * @param singlePlacementGroup the singlePlacementGroup value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withSinglePlacementGroup(Boolean singlePlacementGroup) { + public VirtualMachineScaleSetUpdate withSinglePlacementGroup(Boolean singlePlacementGroup) { this.singlePlacementGroup = singlePlacementGroup; return this; } /** - * Get the identity value. + * Get the identity of the virtual machine scale set, if configured. * * @return the identity value */ @@ -197,12 +191,12 @@ public VirtualMachineScaleSetIdentity identity() { } /** - * Set the identity value. + * Set the identity of the virtual machine scale set, if configured. * * @param identity the identity value to set - * @return the VirtualMachineScaleSetUpdateInner object itself. + * @return the VirtualMachineScaleSetUpdate object itself. */ - public VirtualMachineScaleSetUpdateInner withIdentity(VirtualMachineScaleSetIdentity identity) { + public VirtualMachineScaleSetUpdate withIdentity(VirtualMachineScaleSetIdentity identity) { this.identity = identity; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateIPConfigurationInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateIPConfiguration.java similarity index 55% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateIPConfigurationInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateIPConfiguration.java index 1a512cb71ea..4c86ea31021 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateIPConfigurationInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateIPConfiguration.java @@ -6,11 +6,8 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.ApiEntityReference; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; -import com.microsoft.azure.management.compute.IPVersion; import java.util.List; import com.microsoft.azure.SubResource; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,7 +17,7 @@ * Describes a virtual machine scale set network profile's IP configuration. */ @JsonFlatten -public class VirtualMachineScaleSetUpdateIPConfigurationInner extends SubResource { +public class VirtualMachineScaleSetUpdateIPConfiguration extends SubResource { /** * The IP configuration name. */ @@ -58,7 +55,7 @@ public class VirtualMachineScaleSetUpdateIPConfigurationInner extends SubResourc /** * The application gateway backend address pools. */ - @JsonProperty(value = "properties.applicationGatewayBackendAddressPools") + @JsonProperty(value = "properties.applicationGatewayBackendAddressPoolsIds") private List applicationGatewayBackendAddressPools; /** @@ -74,7 +71,13 @@ public class VirtualMachineScaleSetUpdateIPConfigurationInner extends SubResourc private List loadBalancerInboundNatPools; /** - * Get the name value. + * Gets the applicationSecurityGroups. + */ + @JsonProperty(value = "properties.applicationSecurityGroups") + private List applicationSecurityGroups; + + /** + * Get the IP configuration name. * * @return the name value */ @@ -83,18 +86,18 @@ public String name() { } /** - * Set the name value. + * Set the IP configuration name. * * @param name the name value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withName(String name) { + public VirtualMachineScaleSetUpdateIPConfiguration withName(String name) { this.name = name; return this; } /** - * Get the subnet value. + * Get the subnet. * * @return the subnet value */ @@ -103,18 +106,18 @@ public ApiEntityReference subnet() { } /** - * Set the subnet value. + * Set the subnet. * * @param subnet the subnet value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withSubnet(ApiEntityReference subnet) { + public VirtualMachineScaleSetUpdateIPConfiguration withSubnet(ApiEntityReference subnet) { this.subnet = subnet; return this; } /** - * Get the primary value. + * Get specifies the primary IP Configuration in case the network interface has more than one IP Configuration. * * @return the primary value */ @@ -123,18 +126,18 @@ public Boolean primary() { } /** - * Set the primary value. + * Set specifies the primary IP Configuration in case the network interface has more than one IP Configuration. * * @param primary the primary value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withPrimary(Boolean primary) { + public VirtualMachineScaleSetUpdateIPConfiguration withPrimary(Boolean primary) { this.primary = primary; return this; } /** - * Get the publicIPAddressConfiguration value. + * Get the publicIPAddressConfiguration. * * @return the publicIPAddressConfiguration value */ @@ -143,18 +146,18 @@ public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressC } /** - * Set the publicIPAddressConfiguration value. + * Set the publicIPAddressConfiguration. * * @param publicIPAddressConfiguration the publicIPAddressConfiguration value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withPublicIPAddressConfiguration(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration) { + public VirtualMachineScaleSetUpdateIPConfiguration withPublicIPAddressConfiguration(VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration) { this.publicIPAddressConfiguration = publicIPAddressConfiguration; return this; } /** - * Get the privateIPAddressVersion value. + * Get available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. * * @return the privateIPAddressVersion value */ @@ -163,38 +166,38 @@ public IPVersion privateIPAddressVersion() { } /** - * Set the privateIPAddressVersion value. + * Set available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'. * * @param privateIPAddressVersion the privateIPAddressVersion value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { + public VirtualMachineScaleSetUpdateIPConfiguration withPrivateIPAddressVersion(IPVersion privateIPAddressVersion) { this.privateIPAddressVersion = privateIPAddressVersion; return this; } /** - * Get the applicationGatewayBackendAddressPools value. + * Get the application gateway backend address pools. * - * @return the applicationGatewayBackendAddressPools value + * @return the applicationGatewayBackendAddressPoolsIds value */ public List applicationGatewayBackendAddressPools() { return this.applicationGatewayBackendAddressPools; } /** - * Set the applicationGatewayBackendAddressPools value. + * Set the application gateway backend address pools. * - * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPoolsIds value to set + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + public VirtualMachineScaleSetUpdateIPConfiguration withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; return this; } /** - * Get the loadBalancerBackendAddressPools value. + * Get the load balancer backend address pools. * * @return the loadBalancerBackendAddressPools value */ @@ -203,18 +206,18 @@ public List loadBalancerBackendAddressPools() { } /** - * Set the loadBalancerBackendAddressPools value. + * Set the load balancer backend address pools. * * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + public VirtualMachineScaleSetUpdateIPConfiguration withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; return this; } /** - * Get the loadBalancerInboundNatPools value. + * Get the load balancer inbound nat pools. * * @return the loadBalancerInboundNatPools value */ @@ -223,14 +226,33 @@ public List loadBalancerInboundNatPools() { } /** - * Set the loadBalancerInboundNatPools value. + * Set the load balancer inbound nat pools. * * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set - * @return the VirtualMachineScaleSetUpdateIPConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. */ - public VirtualMachineScaleSetUpdateIPConfigurationInner withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { + public VirtualMachineScaleSetUpdateIPConfiguration withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; return this; } + /** + * Get application security groups. + * + * @return the applicationSecurityGroups value + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set application security groups. + * + * @param applicationSecurityGroups application security groups + * @return the VirtualMachineScaleSetUpdateIPConfiguration object itself. + */ + public VirtualMachineScaleSetUpdateIPConfiguration withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateNetworkConfigurationInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java similarity index 67% rename from azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateNetworkConfigurationInner.java rename to azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java index f5d03c6fd32..bfa2e4c1435 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetUpdateNetworkConfigurationInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java @@ -6,10 +6,9 @@ * Code generated by Microsoft (R) AutoRest Code Generator. */ -package com.microsoft.azure.management.compute.implementation; +package com.microsoft.azure.management.compute; import com.microsoft.azure.SubResource; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkConfigurationDnsSettings; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -19,7 +18,7 @@ * configurations. */ @JsonFlatten -public class VirtualMachineScaleSetUpdateNetworkConfigurationInner extends SubResource { +public class VirtualMachineScaleSetUpdateNetworkConfiguration extends SubResource { /** * The network configuration name. */ @@ -55,7 +54,7 @@ public class VirtualMachineScaleSetUpdateNetworkConfigurationInner extends SubRe * The virtual machine scale set IP Configuration. */ @JsonProperty(value = "properties.ipConfigurations") - private List ipConfigurations; + private List ipConfigurations; /** * Whether IP forwarding enabled on this NIC. @@ -64,7 +63,7 @@ public class VirtualMachineScaleSetUpdateNetworkConfigurationInner extends SubRe private Boolean enableIPForwarding; /** - * Get the name value. + * Get the network configuration name. * * @return the name value */ @@ -73,18 +72,18 @@ public String name() { } /** - * Set the name value. + * Set the network configuration name. * * @param name the name value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withName(String name) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withName(String name) { this.name = name; return this; } /** - * Get the primary value. + * Get whether this is a primary NIC on a virtual machine. * * @return the primary value */ @@ -93,18 +92,18 @@ public Boolean primary() { } /** - * Set the primary value. + * Set whether this is a primary NIC on a virtual machine. * * @param primary the primary value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withPrimary(Boolean primary) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withPrimary(Boolean primary) { this.primary = primary; return this; } /** - * Get the enableAcceleratedNetworking value. + * Get specifies whether the network interface is accelerated networking-enabled. * * @return the enableAcceleratedNetworking value */ @@ -113,18 +112,18 @@ public Boolean enableAcceleratedNetworking() { } /** - * Set the enableAcceleratedNetworking value. + * Set specifies whether the network interface is accelerated networking-enabled. * * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { this.enableAcceleratedNetworking = enableAcceleratedNetworking; return this; } /** - * Get the networkSecurityGroup value. + * Get the network security group. * * @return the networkSecurityGroup value */ @@ -133,18 +132,18 @@ public SubResource networkSecurityGroup() { } /** - * Set the networkSecurityGroup value. + * Set the network security group. * * @param networkSecurityGroup the networkSecurityGroup value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withNetworkSecurityGroup(SubResource networkSecurityGroup) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { this.networkSecurityGroup = networkSecurityGroup; return this; } /** - * Get the dnsSettings value. + * Get the dns settings to be applied on the network interfaces. * * @return the dnsSettings value */ @@ -153,38 +152,38 @@ public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { } /** - * Set the dnsSettings value. + * Set the dns settings to be applied on the network interfaces. * * @param dnsSettings the dnsSettings value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { this.dnsSettings = dnsSettings; return this; } /** - * Get the ipConfigurations value. + * Get the virtual machine scale set IP Configuration. * * @return the ipConfigurations value */ - public List ipConfigurations() { + public List ipConfigurations() { return this.ipConfigurations; } /** - * Set the ipConfigurations value. + * Set the virtual machine scale set IP Configuration. * * @param ipConfigurations the ipConfigurations value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withIpConfigurations(List ipConfigurations) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withIpConfigurations(List ipConfigurations) { this.ipConfigurations = ipConfigurations; return this; } /** - * Get the enableIPForwarding value. + * Get whether IP forwarding enabled on this NIC. * * @return the enableIPForwarding value */ @@ -193,12 +192,12 @@ public Boolean enableIPForwarding() { } /** - * Set the enableIPForwarding value. + * Set whether IP forwarding enabled on this NIC. * * @param enableIPForwarding the enableIPForwarding value to set - * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + * @return the VirtualMachineScaleSetUpdateNetworkConfiguration object itself. */ - public VirtualMachineScaleSetUpdateNetworkConfigurationInner withEnableIPForwarding(Boolean enableIPForwarding) { + public VirtualMachineScaleSetUpdateNetworkConfiguration withEnableIPForwarding(Boolean enableIPForwarding) { this.enableIPForwarding = enableIPForwarding; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java index 89c70b933da..d7d32db277c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.compute; import java.util.List; -import com.microsoft.azure.management.compute.implementation.VirtualMachineScaleSetUpdateNetworkConfigurationInner; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -20,24 +19,24 @@ public class VirtualMachineScaleSetUpdateNetworkProfile { * The list of network configurations. */ @JsonProperty(value = "networkInterfaceConfigurations") - private List networkInterfaceConfigurations; + private List networkInterfaceConfigurations; /** - * Get the networkInterfaceConfigurations value. + * Get the list of network configurations. * * @return the networkInterfaceConfigurations value */ - public List networkInterfaceConfigurations() { + public List networkInterfaceConfigurations() { return this.networkInterfaceConfigurations; } /** - * Set the networkInterfaceConfigurations value. + * Set the list of network configurations. * * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set * @return the VirtualMachineScaleSetUpdateNetworkProfile object itself. */ - public VirtualMachineScaleSetUpdateNetworkProfile withNetworkInterfaceConfigurations(List networkInterfaceConfigurations) { + public VirtualMachineScaleSetUpdateNetworkProfile withNetworkInterfaceConfigurations(List networkInterfaceConfigurations) { this.networkInterfaceConfigurations = networkInterfaceConfigurations; return this; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java index acbd5463e0b..d7582a3f5f7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java @@ -51,7 +51,7 @@ public class VirtualMachineScaleSetUpdateOSDisk { private VirtualMachineScaleSetManagedDiskParameters managedDisk; /** - * Get the caching value. + * Get the caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @return the caching value */ @@ -60,7 +60,7 @@ public CachingTypes caching() { } /** - * Set the caching value. + * Set the caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. * * @param caching the caching value to set * @return the VirtualMachineScaleSetUpdateOSDisk object itself. @@ -71,7 +71,7 @@ public VirtualMachineScaleSetUpdateOSDisk withCaching(CachingTypes caching) { } /** - * Get the writeAcceleratorEnabled value. + * Get specifies whether writeAccelerator should be enabled or disabled on the disk. * * @return the writeAcceleratorEnabled value */ @@ -80,7 +80,7 @@ public Boolean writeAcceleratorEnabled() { } /** - * Set the writeAcceleratorEnabled value. + * Set specifies whether writeAccelerator should be enabled or disabled on the disk. * * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set * @return the VirtualMachineScaleSetUpdateOSDisk object itself. @@ -91,7 +91,7 @@ public VirtualMachineScaleSetUpdateOSDisk withWriteAcceleratorEnabled(Boolean wr } /** - * Get the image value. + * Get the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. * * @return the image value */ @@ -100,7 +100,7 @@ public VirtualHardDisk image() { } /** - * Set the image value. + * Set the Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. * * @param image the image value to set * @return the VirtualMachineScaleSetUpdateOSDisk object itself. @@ -111,7 +111,7 @@ public VirtualMachineScaleSetUpdateOSDisk withImage(VirtualHardDisk image) { } /** - * Get the vhdContainers value. + * Get the list of virtual hard disk container uris. * * @return the vhdContainers value */ @@ -120,7 +120,7 @@ public List vhdContainers() { } /** - * Set the vhdContainers value. + * Set the list of virtual hard disk container uris. * * @param vhdContainers the vhdContainers value to set * @return the VirtualMachineScaleSetUpdateOSDisk object itself. @@ -131,7 +131,7 @@ public VirtualMachineScaleSetUpdateOSDisk withVhdContainers(List vhdCont } /** - * Get the managedDisk value. + * Get the managed disk parameters. * * @return the managedDisk value */ @@ -140,7 +140,7 @@ public VirtualMachineScaleSetManagedDiskParameters managedDisk() { } /** - * Set the managedDisk value. + * Set the managed disk parameters. * * @param managedDisk the managedDisk value to set * @return the VirtualMachineScaleSetUpdateOSDisk object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java index dcee27e6610..5610312d07a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java @@ -40,7 +40,7 @@ public class VirtualMachineScaleSetUpdateOSProfile { private List secrets; /** - * Get the customData value. + * Get a base-64 encoded string of custom data. * * @return the customData value */ @@ -49,7 +49,7 @@ public String customData() { } /** - * Set the customData value. + * Set a base-64 encoded string of custom data. * * @param customData the customData value to set * @return the VirtualMachineScaleSetUpdateOSProfile object itself. @@ -60,7 +60,7 @@ public VirtualMachineScaleSetUpdateOSProfile withCustomData(String customData) { } /** - * Get the windowsConfiguration value. + * Get the Windows Configuration of the OS profile. * * @return the windowsConfiguration value */ @@ -69,7 +69,7 @@ public WindowsConfiguration windowsConfiguration() { } /** - * Set the windowsConfiguration value. + * Set the Windows Configuration of the OS profile. * * @param windowsConfiguration the windowsConfiguration value to set * @return the VirtualMachineScaleSetUpdateOSProfile object itself. @@ -80,7 +80,7 @@ public VirtualMachineScaleSetUpdateOSProfile withWindowsConfiguration(WindowsCon } /** - * Get the linuxConfiguration value. + * Get the Linux Configuration of the OS profile. * * @return the linuxConfiguration value */ @@ -89,7 +89,7 @@ public LinuxConfiguration linuxConfiguration() { } /** - * Set the linuxConfiguration value. + * Set the Linux Configuration of the OS profile. * * @param linuxConfiguration the linuxConfiguration value to set * @return the VirtualMachineScaleSetUpdateOSProfile object itself. @@ -100,7 +100,7 @@ public VirtualMachineScaleSetUpdateOSProfile withLinuxConfiguration(LinuxConfigu } /** - * Get the secrets value. + * Get the List of certificates for addition to the VM. * * @return the secrets value */ @@ -109,7 +109,7 @@ public List secrets() { } /** - * Set the secrets value. + * Set the List of certificates for addition to the VM. * * @param secrets the secrets value to set * @return the VirtualMachineScaleSetUpdateOSProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.java index e8648f0dc10..073616e978c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.java @@ -36,7 +36,7 @@ public class VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { private VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings; /** - * Get the name value. + * Get the publicIP address configuration name. * * @return the name value */ @@ -45,7 +45,7 @@ public String name() { } /** - * Set the name value. + * Set the publicIP address configuration name. * * @param name the name value to set * @return the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration object itself. @@ -56,7 +56,7 @@ public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration withName(String } /** - * Get the idleTimeoutInMinutes value. + * Get the idle timeout of the public IP address. * * @return the idleTimeoutInMinutes value */ @@ -65,7 +65,7 @@ public Integer idleTimeoutInMinutes() { } /** - * Set the idleTimeoutInMinutes value. + * Set the idle timeout of the public IP address. * * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set * @return the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration object itself. @@ -76,7 +76,7 @@ public VirtualMachineScaleSetUpdatePublicIPAddressConfiguration withIdleTimeoutI } /** - * Get the dnsSettings value. + * Get the dns settings to be applied on the publicIP addresses . * * @return the dnsSettings value */ @@ -85,7 +85,7 @@ public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings } /** - * Set the dnsSettings value. + * Set the dns settings to be applied on the publicIP addresses . * * @param dnsSettings the dnsSettings value to set * @return the VirtualMachineScaleSetUpdatePublicIPAddressConfiguration object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java index cb0f3dca337..faa5a53aa2f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java @@ -8,7 +8,6 @@ package com.microsoft.azure.management.compute; -import com.microsoft.azure.management.compute.implementation.ImageReferenceInner; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,7 +19,7 @@ public class VirtualMachineScaleSetUpdateStorageProfile { * The image reference. */ @JsonProperty(value = "imageReference") - private ImageReferenceInner imageReference; + private ImageReference imageReference; /** * The OS disk. @@ -35,27 +34,27 @@ public class VirtualMachineScaleSetUpdateStorageProfile { private List dataDisks; /** - * Get the imageReference value. + * Get the image reference. * * @return the imageReference value */ - public ImageReferenceInner imageReference() { + public ImageReference imageReference() { return this.imageReference; } /** - * Set the imageReference value. + * Set the image reference. * * @param imageReference the imageReference value to set * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. */ - public VirtualMachineScaleSetUpdateStorageProfile withImageReference(ImageReferenceInner imageReference) { + public VirtualMachineScaleSetUpdateStorageProfile withImageReference(ImageReference imageReference) { this.imageReference = imageReference; return this; } /** - * Get the osDisk value. + * Get the OS disk. * * @return the osDisk value */ @@ -64,7 +63,7 @@ public VirtualMachineScaleSetUpdateOSDisk osDisk() { } /** - * Set the osDisk value. + * Set the OS disk. * * @param osDisk the osDisk value to set * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. @@ -75,7 +74,7 @@ public VirtualMachineScaleSetUpdateStorageProfile withOsDisk(VirtualMachineScale } /** - * Get the dataDisks value. + * Get the data disks. * * @return the dataDisks value */ @@ -84,7 +83,7 @@ public List dataDisks() { } /** - * Set the dataDisks value. + * Set the data disks. * * @param dataDisks the dataDisks value to set * @return the VirtualMachineScaleSetUpdateStorageProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java index 007b699a094..3a2911c9323 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java @@ -51,7 +51,7 @@ public class VirtualMachineScaleSetUpdateVMProfile { private String licenseType; /** - * Get the osProfile value. + * Get the virtual machine scale set OS profile. * * @return the osProfile value */ @@ -60,7 +60,7 @@ public VirtualMachineScaleSetUpdateOSProfile osProfile() { } /** - * Set the osProfile value. + * Set the virtual machine scale set OS profile. * * @param osProfile the osProfile value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. @@ -71,7 +71,7 @@ public VirtualMachineScaleSetUpdateVMProfile withOsProfile(VirtualMachineScaleSe } /** - * Get the storageProfile value. + * Get the virtual machine scale set storage profile. * * @return the storageProfile value */ @@ -80,7 +80,7 @@ public VirtualMachineScaleSetUpdateStorageProfile storageProfile() { } /** - * Set the storageProfile value. + * Set the virtual machine scale set storage profile. * * @param storageProfile the storageProfile value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. @@ -91,7 +91,7 @@ public VirtualMachineScaleSetUpdateVMProfile withStorageProfile(VirtualMachineSc } /** - * Get the networkProfile value. + * Get the virtual machine scale set network profile. * * @return the networkProfile value */ @@ -100,7 +100,7 @@ public VirtualMachineScaleSetUpdateNetworkProfile networkProfile() { } /** - * Set the networkProfile value. + * Set the virtual machine scale set network profile. * * @param networkProfile the networkProfile value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. @@ -111,7 +111,7 @@ public VirtualMachineScaleSetUpdateVMProfile withNetworkProfile(VirtualMachineSc } /** - * Get the diagnosticsProfile value. + * Get the virtual machine scale set diagnostics profile. * * @return the diagnosticsProfile value */ @@ -120,7 +120,7 @@ public DiagnosticsProfile diagnosticsProfile() { } /** - * Set the diagnosticsProfile value. + * Set the virtual machine scale set diagnostics profile. * * @param diagnosticsProfile the diagnosticsProfile value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. @@ -131,7 +131,7 @@ public VirtualMachineScaleSetUpdateVMProfile withDiagnosticsProfile(DiagnosticsP } /** - * Get the extensionProfile value. + * Get the virtual machine scale set extension profile. * * @return the extensionProfile value */ @@ -140,7 +140,7 @@ public VirtualMachineScaleSetExtensionProfile extensionProfile() { } /** - * Set the extensionProfile value. + * Set the virtual machine scale set extension profile. * * @param extensionProfile the extensionProfile value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. @@ -151,7 +151,7 @@ public VirtualMachineScaleSetUpdateVMProfile withExtensionProfile(VirtualMachine } /** - * Get the licenseType value. + * Get the license type, which is for bring your own license scenario. * * @return the licenseType value */ @@ -160,7 +160,7 @@ public String licenseType() { } /** - * Set the licenseType value. + * Set the license type, which is for bring your own license scenario. * * @param licenseType the licenseType value to set * @return the VirtualMachineScaleSetUpdateVMProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java index 7622465c834..32cb2bc3028 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java @@ -28,7 +28,7 @@ public class VirtualMachineScaleSetVMExtensionsSummary { private List statusesSummary; /** - * Get the name value. + * Get the extension name. * * @return the name value */ @@ -37,7 +37,7 @@ public String name() { } /** - * Get the statusesSummary value. + * Get the extensions information. * * @return the statusesSummary value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java index 74a02bc0332..bdaa7933a82 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java @@ -24,7 +24,7 @@ public class VirtualMachineScaleSetVMInstanceIDs { private List instanceIds; /** - * Get the instanceIds value. + * Get the virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * * @return the instanceIds value */ @@ -33,7 +33,7 @@ public List instanceIds() { } /** - * Set the instanceIds value. + * Set the virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * * @param instanceIds the instanceIds value to set * @return the VirtualMachineScaleSetVMInstanceIDs object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java index 0ca421ce76b..c32c45d0be1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java @@ -22,7 +22,7 @@ public class VirtualMachineScaleSetVMInstanceRequiredIDs { private List instanceIds; /** - * Get the instanceIds value. + * Get the virtual machine scale set instance ids. * * @return the instanceIds value */ @@ -31,7 +31,7 @@ public List instanceIds() { } /** - * Set the instanceIds value. + * Set the virtual machine scale set instance ids. * * @param instanceIds the instanceIds value to set * @return the VirtualMachineScaleSetVMInstanceRequiredIDs object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMProfile.java index 346adc9f02f..c874432d836 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMProfile.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetVMProfile.java @@ -80,7 +80,7 @@ public class VirtualMachineScaleSetVMProfile { private VirtualMachineEvictionPolicyTypes evictionPolicy; /** - * Get the osProfile value. + * Get specifies the operating system settings for the virtual machines in the scale set. * * @return the osProfile value */ @@ -89,7 +89,7 @@ public VirtualMachineScaleSetOSProfile osProfile() { } /** - * Set the osProfile value. + * Set specifies the operating system settings for the virtual machines in the scale set. * * @param osProfile the osProfile value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -100,7 +100,7 @@ public VirtualMachineScaleSetVMProfile withOsProfile(VirtualMachineScaleSetOSPro } /** - * Get the storageProfile value. + * Get specifies the storage settings for the virtual machine disks. * * @return the storageProfile value */ @@ -109,7 +109,7 @@ public VirtualMachineScaleSetStorageProfile storageProfile() { } /** - * Set the storageProfile value. + * Set specifies the storage settings for the virtual machine disks. * * @param storageProfile the storageProfile value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -120,7 +120,7 @@ public VirtualMachineScaleSetVMProfile withStorageProfile(VirtualMachineScaleSet } /** - * Get the networkProfile value. + * Get specifies properties of the network interfaces of the virtual machines in the scale set. * * @return the networkProfile value */ @@ -129,7 +129,7 @@ public VirtualMachineScaleSetNetworkProfile networkProfile() { } /** - * Set the networkProfile value. + * Set specifies properties of the network interfaces of the virtual machines in the scale set. * * @param networkProfile the networkProfile value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -140,7 +140,7 @@ public VirtualMachineScaleSetVMProfile withNetworkProfile(VirtualMachineScaleSet } /** - * Get the diagnosticsProfile value. + * Get specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @return the diagnosticsProfile value */ @@ -149,7 +149,7 @@ public DiagnosticsProfile diagnosticsProfile() { } /** - * Set the diagnosticsProfile value. + * Set specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @param diagnosticsProfile the diagnosticsProfile value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -160,7 +160,7 @@ public VirtualMachineScaleSetVMProfile withDiagnosticsProfile(DiagnosticsProfile } /** - * Get the extensionProfile value. + * Get specifies a collection of settings for extensions installed on virtual machines in the scale set. * * @return the extensionProfile value */ @@ -169,7 +169,7 @@ public VirtualMachineScaleSetExtensionProfile extensionProfile() { } /** - * Set the extensionProfile value. + * Set specifies a collection of settings for extensions installed on virtual machines in the scale set. * * @param extensionProfile the extensionProfile value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -180,7 +180,7 @@ public VirtualMachineScaleSetVMProfile withExtensionProfile(VirtualMachineScaleS } /** - * Get the licenseType value. + * 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. * * @return the licenseType value */ @@ -189,7 +189,7 @@ public String licenseType() { } /** - * Set the licenseType value. + * 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. * * @param licenseType the licenseType value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -200,7 +200,7 @@ public VirtualMachineScaleSetVMProfile withLicenseType(String licenseType) { } /** - * Get the priority value. + * Get specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low'. * * @return the priority value */ @@ -209,7 +209,7 @@ public VirtualMachinePriorityTypes priority() { } /** - * Set the priority value. + * Set specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low'. * * @param priority the priority value to set * @return the VirtualMachineScaleSetVMProfile object itself. @@ -220,7 +220,7 @@ public VirtualMachineScaleSetVMProfile withPriority(VirtualMachinePriorityTypes } /** - * Get the evictionPolicy value. + * Get specifies the eviction policy for virtual machines in a low priority scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'. * * @return the evictionPolicy value */ @@ -229,7 +229,7 @@ public VirtualMachineEvictionPolicyTypes evictionPolicy() { } /** - * Set the evictionPolicy value. + * Set specifies the eviction policy for virtual machines in a low priority scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'. * * @param evictionPolicy the evictionPolicy value to set * @return the VirtualMachineScaleSetVMProfile object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineStatusCodeCount.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineStatusCodeCount.java index d01aff0f168..f85980605a6 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineStatusCodeCount.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineStatusCodeCount.java @@ -28,7 +28,7 @@ public class VirtualMachineStatusCodeCount { private Integer count; /** - * Get the code value. + * Get the instance view status code. * * @return the code value */ @@ -37,7 +37,7 @@ public String code() { } /** - * Get the count value. + * Get the number of instances having a particular status code. * * @return the count value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineUpdate.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineUpdate.java new file mode 100644 index 00000000000..f7dadd872d1 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineUpdate.java @@ -0,0 +1,355 @@ +/** + * 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; + +import com.microsoft.azure.SubResource; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a Virtual Machine Update. + */ +@JsonFlatten +public class VirtualMachineUpdate extends UpdateResource { + /** + * Specifies information about the marketplace image used to create the + * virtual machine. This element is only used for marketplace images. + * Before you can use a marketplace image from an API, you must enable the + * image for programmatic use. In the Azure portal, find the marketplace + * image that you want to use and then click **Want to deploy + * programmatically, Get Started ->**. Enter any required information + * and then click **Save**. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /** + * Specifies the hardware settings for the virtual machine. + */ + @JsonProperty(value = "properties.hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * Specifies the operating system settings for the virtual machine. + */ + @JsonProperty(value = "properties.osProfile") + private OSProfile osProfile; + + /** + * Specifies the network interfaces of the virtual machine. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /** + * Specifies the boot diagnostic settings state. + * <br><br>Minimum api-version: 2015-06-15. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /** + * Specifies information about the availability set that the virtual + * machine should be assigned to. Virtual machines specified in the same + * availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see [Manage + * the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintainance, + * see [Planned maintenance for virtual machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <br><br> Currently, a VM can only be added to availability + * set at creation time. An existing VM cannot be added to an availability + * set. + */ + @JsonProperty(value = "properties.availabilitySet") + private SubResource availabilitySet; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The virtual machine instance view. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineInstanceView instanceView; + + /** + * 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. + */ + @JsonProperty(value = "properties.licenseType") + private String licenseType; + + /** + * Specifies the VM unique ID which is a 128-bits identifier that is + * encoded and stored in all Azure IaaS VMs SMBIOS and can be read using + * platform BIOS commands. + */ + @JsonProperty(value = "properties.vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /** + * The identity of the virtual machine, if configured. + */ + @JsonProperty(value = "identity") + private VirtualMachineIdentity identity; + + /** + * The virtual machine zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + * + * @return the plan value + */ + public Plan plan() { + return this.plan; + } + + /** + * Set specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + * + * @param plan the plan value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get specifies the hardware settings for the virtual machine. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set specifies the hardware settings for the virtual machine. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get specifies the operating system settings for the virtual machine. + * + * @return the osProfile value + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set specifies the operating system settings for the virtual machine. + * + * @param osProfile the osProfile value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get specifies the network interfaces of the virtual machine. + * + * @return the networkProfile value + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set specifies the network interfaces of the virtual machine. + * + * @param networkProfile the networkProfile value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. + * + * @return the diagnosticsProfile value + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @return the availabilitySet value + */ + public SubResource availabilitySet() { + return this.availabilitySet; + } + + /** + * Set specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + * + * @param availabilitySet the availabilitySet value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withAvailabilitySet(SubResource availabilitySet) { + this.availabilitySet = availabilitySet; + 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 instance view. + * + * @return the instanceView value + */ + public VirtualMachineInstanceView instanceView() { + return this.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. + * + * @return the licenseType value + */ + public String licenseType() { + return this.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. + * + * @param licenseType the licenseType value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Get the identity of the virtual machine, if configured. + * + * @return the identity value + */ + public VirtualMachineIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the virtual machine, if configured. + * + * @param identity the identity value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withIdentity(VirtualMachineIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the virtual machine zones. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the virtual machine zones. + * + * @param zones the zones value to set + * @return the VirtualMachineUpdate object itself. + */ + public VirtualMachineUpdate withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMConfiguration.java index f3ea05a5f3f..8ad0917a52b 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMConfiguration.java @@ -22,7 +22,7 @@ public class WinRMConfiguration { private List listeners; /** - * Get the listeners value. + * Get the list of Windows Remote Management listeners. * * @return the listeners value */ @@ -31,7 +31,7 @@ public List listeners() { } /** - * Set the listeners value. + * Set the list of Windows Remote Management listeners. * * @param listeners the listeners value to set * @return the WinRMConfiguration object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMListener.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMListener.java index 0a68b81ac17..98f6aa49ff0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMListener.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WinRMListener.java @@ -38,7 +38,7 @@ public class WinRMListener { private String certificateUrl; /** - * Get the protocol value. + * Get specifies the protocol of listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'Http', 'Https'. * * @return the protocol value */ @@ -47,7 +47,7 @@ public ProtocolTypes protocol() { } /** - * Set the protocol value. + * Set specifies the protocol of listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'Http', 'Https'. * * @param protocol the protocol value to set * @return the WinRMListener object itself. @@ -58,7 +58,7 @@ public WinRMListener withProtocol(ProtocolTypes protocol) { } /** - * Get the certificateUrl value. + * Get this is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. * * @return the certificateUrl value */ @@ -67,7 +67,7 @@ public String certificateUrl() { } /** - * Set the certificateUrl value. + * Set this is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. * * @param certificateUrl the certificateUrl value to set * @return the WinRMListener object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WindowsConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WindowsConfiguration.java index eedd3449b0e..d72f07811ee 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WindowsConfiguration.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/WindowsConfiguration.java @@ -53,7 +53,7 @@ public class WindowsConfiguration { private WinRMConfiguration winRM; /** - * Get the provisionVMAgent value. + * Get indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. * * @return the provisionVMAgent value */ @@ -62,7 +62,7 @@ public Boolean provisionVMAgent() { } /** - * Set the provisionVMAgent value. + * Set indicates whether virtual machine agent should be provisioned on the virtual machine. <br><br> When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. * * @param provisionVMAgent the provisionVMAgent value to set * @return the WindowsConfiguration object itself. @@ -73,7 +73,7 @@ public WindowsConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { } /** - * Get the enableAutomaticUpdates value. + * Get indicates whether virtual machine is enabled for automatic updates. * * @return the enableAutomaticUpdates value */ @@ -82,7 +82,7 @@ public Boolean enableAutomaticUpdates() { } /** - * Set the enableAutomaticUpdates value. + * Set indicates whether virtual machine is enabled for automatic updates. * * @param enableAutomaticUpdates the enableAutomaticUpdates value to set * @return the WindowsConfiguration object itself. @@ -93,7 +93,7 @@ public WindowsConfiguration withEnableAutomaticUpdates(Boolean enableAutomaticUp } /** - * Get the timeZone value. + * Get specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". * * @return the timeZone value */ @@ -102,7 +102,7 @@ public String timeZone() { } /** - * Set the timeZone value. + * Set specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". * * @param timeZone the timeZone value to set * @return the WindowsConfiguration object itself. @@ -113,7 +113,7 @@ public WindowsConfiguration withTimeZone(String timeZone) { } /** - * Get the additionalUnattendContent value. + * Get specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. * * @return the additionalUnattendContent value */ @@ -122,7 +122,7 @@ public List additionalUnattendContent() { } /** - * Set the additionalUnattendContent value. + * Set specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. * * @param additionalUnattendContent the additionalUnattendContent value to set * @return the WindowsConfiguration object itself. @@ -133,7 +133,7 @@ public WindowsConfiguration withAdditionalUnattendContent(List virtualMachines() { } /** - * Set the virtualMachines value. + * Set a list of references to all virtual machines in the availability set. * * @param virtualMachines the virtualMachines value to set * @return the AvailabilitySetInner object itself. @@ -121,7 +121,7 @@ public AvailabilitySetInner withVirtualMachines(List virtualMachine } /** - * Get the statuses value. + * Get the resource status information. * * @return the statuses value */ @@ -130,7 +130,7 @@ public List statuses() { } /** - * Get the sku value. + * Get sku of the availability set. * * @return the sku value */ @@ -139,7 +139,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set sku of the availability set. * * @param sku the sku value to set * @return the AvailabilitySetInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java index df52c45b336..f7b8239a21f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java @@ -13,6 +13,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.compute.AvailabilitySetUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -27,6 +28,7 @@ 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; @@ -38,7 +40,7 @@ * An instance of this class provides access to all the operations defined * in AvailabilitySets. */ -public class AvailabilitySetsInner implements InnerSupportsGet, InnerSupportsDelete { +public class AvailabilitySetsInner implements InnerSupportsGet, InnerSupportsDelete { /** The Retrofit service to perform REST calls. */ private AvailabilitySetsService service; /** The service client containing this operation class. */ @@ -64,6 +66,10 @@ interface AvailabilitySetsService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}") Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("availabilitySetName") String availabilitySetName, @Path("subscriptionId") String subscriptionId, @Body AvailabilitySetInner parameters, @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.AvailabilitySets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("availabilitySetName") String availabilitySetName, @Path("subscriptionId") String subscriptionId, @Body AvailabilitySetUpdate parameters, @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.AvailabilitySets delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("availabilitySetName") String availabilitySetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -152,7 +158,7 @@ public Observable> createOrUpdateWithServi throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.createOrUpdate(resourceGroupName, availabilitySetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -174,6 +180,98 @@ private ServiceResponse createOrUpdateDelegate(Response updateAsync(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, availabilitySetName, parameters), serviceCallback); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilitySetInner object + */ + public Observable updateAsync(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, availabilitySetName, parameters).map(new Func1, AvailabilitySetInner>() { + @Override + public AvailabilitySetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Parameters supplied to the Update Availability Set operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AvailabilitySetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (availabilitySetName == null) { + throw new IllegalArgumentException("Parameter availabilitySetName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.update(resourceGroupName, availabilitySetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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); + } + /** * Delete an availability set. * @@ -182,10 +280,9 @@ private ServiceResponse createOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String availabilitySetName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String availabilitySetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName), serviceCallback); } @@ -207,12 +304,12 @@ public ServiceFuture deleteAsync(String resourceGr * @param resourceGroupName The name of the resource group. * @param availabilitySetName The name of the availability set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteAsync(String resourceGroupName, String availabilitySetName) { - return deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String availabilitySetName) { + return deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -224,9 +321,9 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String availabilitySetName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String availabilitySetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -236,13 +333,13 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.delete(resourceGroupName, availabilitySetName, this.client.subscriptionId(), 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 = deleteDelegate(response); + ServiceResponse clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -251,9 +348,9 @@ public Observable> call(Response deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); @@ -321,7 +418,7 @@ public Observable> getByResourceGroupWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getByResourceGroup(resourceGroupName, availabilitySetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -402,14 +499,18 @@ public Observable>> listByResourceGro if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { ServiceResponse> result = listByResourceGroupDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -487,14 +588,18 @@ public Observable>> listAvailableS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listAvailableSizes(resourceGroupName, availabilitySetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { ServiceResponse> result = listAvailableSizesDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeManagementClientImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeManagementClientImpl.java index d9c642b0397..08cb4f469d4 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeManagementClientImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeManagementClientImpl.java @@ -51,11 +51,11 @@ public ComputeManagementClientImpl withSubscriptionId(String subscriptionId) { return this; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -64,7 +64,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -74,11 +74,11 @@ public ComputeManagementClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -87,7 +87,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -97,11 +97,11 @@ public ComputeManagementClientImpl withLongRunningOperationRetryTimeout(int long return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -110,7 +110,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -120,6 +120,19 @@ public ComputeManagementClientImpl withGenerateClientRequestId(boolean generateC return this; } + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + /** * The AvailabilitySetsInner object to access its operations. */ @@ -341,6 +354,45 @@ public SnapshotsInner snapshots() { return this.snapshots; } + /** + * The GalleriesInner object to access its operations. + */ + private GalleriesInner galleries; + + /** + * Gets the GalleriesInner object to access its operations. + * @return the GalleriesInner object. + */ + public GalleriesInner galleries() { + return this.galleries; + } + + /** + * The GalleryImagesInner object to access its operations. + */ + private GalleryImagesInner galleryImages; + + /** + * Gets the GalleryImagesInner object to access its operations. + * @return the GalleryImagesInner object. + */ + public GalleryImagesInner galleryImages() { + return this.galleryImages; + } + + /** + * The GalleryImageVersionsInner object to access its operations. + */ + private GalleryImageVersionsInner galleryImageVersions; + + /** + * Gets the GalleryImageVersionsInner object to access its operations. + * @return the GalleryImageVersionsInner object. + */ + public GalleryImageVersionsInner galleryImageVersions() { + return this.galleryImageVersions; + } + /** * Initializes an instance of ComputeManagementClient client. * @@ -375,6 +427,7 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); this.availabilitySets = new AvailabilitySetsInner(restClient().retrofit(), this); this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesInner(restClient().retrofit(), this); this.virtualMachineExtensions = new VirtualMachineExtensionsInner(restClient().retrofit(), this); @@ -392,6 +445,9 @@ protected void initialize() { this.resourceSkus = new ResourceSkusInner(restClient().retrofit(), this); this.disks = new DisksInner(restClient().retrofit(), this); this.snapshots = new SnapshotsInner(restClient().retrofit(), this); + this.galleries = new GalleriesInner(restClient().retrofit(), this); + this.galleryImages = new GalleryImagesInner(restClient().retrofit(), this); + this.galleryImageVersions = new GalleryImageVersionsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeOperationValueInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeOperationValueInner.java new file mode 100644 index 00000000000..fffa7d9bd97 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ComputeOperationValueInner.java @@ -0,0 +1,109 @@ +/** + * 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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes the properties of a Compute Operation value. + */ +@JsonFlatten +public class ComputeOperationValueInner { + /** + * The origin of the compute operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The name of the compute operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display name of the compute operation. + */ + @JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The description of the operation. + */ + @JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The resource provider for the operation. + */ + @JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the origin of the compute operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the name of the compute operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display name of the compute operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the display name of the resource the operation applies to. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the resource provider for the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskImpl.java index 052a5862e4b..df8ae77af03 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.compute.CreationSource; import com.microsoft.azure.management.compute.DiskSku; import com.microsoft.azure.management.compute.DiskSkuTypes; +import com.microsoft.azure.management.compute.GrantAccessData; import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.Snapshot; import com.microsoft.azure.management.resources.fluentcore.arm.AvailabilityZoneId; @@ -102,7 +103,7 @@ public String grantAccess(int accessDurationInSeconds) { @Override public Observable grantAccessAsync(int accessDurationInSeconds) { - GrantAccessDataInner grantAccessDataInner = new GrantAccessDataInner(); + GrantAccessData grantAccessDataInner = new GrantAccessData(); grantAccessDataInner.withAccess(AccessLevel.READ) .withDurationInSeconds(accessDurationInSeconds); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskInner.java index 8f587559f61..18deeff66dc 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskInner.java @@ -83,7 +83,7 @@ public class DiskInner extends Resource { private String provisioningState; /** - * Get the managedBy value. + * Get a relative URI containing the ID of the VM that has the disk attached. * * @return the managedBy value */ @@ -112,7 +112,7 @@ public DiskInner withSku(DiskSku sku) { } /** - * Get the zones value. + * Get the Logical zone list for Disk. * * @return the zones value */ @@ -121,7 +121,7 @@ public List zones() { } /** - * Set the zones value. + * Set the Logical zone list for Disk. * * @param zones the zones value to set * @return the DiskInner object itself. @@ -132,7 +132,7 @@ public DiskInner withZones(List zones) { } /** - * Get the timeCreated value. + * Get the time when the disk was created. * * @return the timeCreated value */ @@ -141,7 +141,7 @@ public DateTime timeCreated() { } /** - * Get the osType value. + * Get the Operating System type. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -150,7 +150,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set the Operating System type. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the DiskInner object itself. @@ -161,7 +161,7 @@ public DiskInner withOsType(OperatingSystemTypes osType) { } /** - * Get the creationData value. + * Get disk source information. CreationData information cannot be changed after the disk has been created. * * @return the creationData value */ @@ -170,7 +170,7 @@ public CreationData creationData() { } /** - * Set the creationData value. + * Set disk source information. CreationData information cannot be changed after the disk has been created. * * @param creationData the creationData value to set * @return the DiskInner object itself. @@ -181,7 +181,7 @@ public DiskInner withCreationData(CreationData creationData) { } /** - * Get the diskSizeGB value. + * Get if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. * * @return the diskSizeGB value */ @@ -190,7 +190,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. * * @param diskSizeGB the diskSizeGB value to set * @return the DiskInner object itself. @@ -201,7 +201,7 @@ public DiskInner withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the encryptionSettings value. + * Get encryption settings for disk or snapshot. * * @return the encryptionSettings value */ @@ -210,7 +210,7 @@ public EncryptionSettings encryptionSettings() { } /** - * Set the encryptionSettings value. + * Set encryption settings for disk or snapshot. * * @param encryptionSettings the encryptionSettings value to set * @return the DiskInner object itself. @@ -221,7 +221,7 @@ public DiskInner withEncryptionSettings(EncryptionSettings encryptionSettings) { } /** - * Get the provisioningState value. + * Get the disk provisioning state. * * @return the provisioningState value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskUpdateInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskUpdateInner.java deleted file mode 100644 index fdbd334f3eb..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DiskUpdateInner.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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.implementation; - -import com.microsoft.azure.management.compute.OperatingSystemTypes; -import com.microsoft.azure.management.compute.EncryptionSettings; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.management.compute.ResourceUpdate; - -/** - * Disk update resource. - */ -@JsonFlatten -public class DiskUpdateInner extends ResourceUpdate { - /** - * the Operating System type. Possible values include: 'Windows', 'Linux'. - */ - @JsonProperty(value = "properties.osType") - private OperatingSystemTypes osType; - - /** - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the VHD to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "properties.diskSizeGB") - private Integer diskSizeGB; - - /** - * Encryption settings for disk or snapshot. - */ - @JsonProperty(value = "properties.encryptionSettings") - private EncryptionSettings encryptionSettings; - - /** - * Get the osType value. - * - * @return the osType value - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType value. - * - * @param osType the osType value to set - * @return the DiskUpdateInner object itself. - */ - public DiskUpdateInner withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the diskSizeGB value. - * - * @return the diskSizeGB value - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB value. - * - * @param diskSizeGB the diskSizeGB value to set - * @return the DiskUpdateInner object itself. - */ - public DiskUpdateInner withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the encryptionSettings value. - * - * @return the encryptionSettings value - */ - public EncryptionSettings encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings value. - * - * @param encryptionSettings the encryptionSettings value to set - * @return the DiskUpdateInner object itself. - */ - public DiskUpdateInner withEncryptionSettings(EncryptionSettings encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksImpl.java index d92e101bbb0..96f5253d68a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksImpl.java @@ -10,6 +10,7 @@ import com.microsoft.azure.management.compute.AccessLevel; import com.microsoft.azure.management.compute.Disk; import com.microsoft.azure.management.compute.Disks; +import com.microsoft.azure.management.compute.GrantAccessData; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -46,7 +47,7 @@ public String grantAccess(String resourceGroupName, @Override public Observable grantAccessAsync(String resourceGroupName, String diskName, AccessLevel accessLevel, int accessDuration) { - GrantAccessDataInner grantAccessDataInner = new GrantAccessDataInner(); + GrantAccessData grantAccessDataInner = new GrantAccessData(); grantAccessDataInner.withAccess(accessLevel) .withDurationInSeconds(accessDuration); return this.inner().grantAccessAsync(resourceGroupName, diskName, grantAccessDataInner) diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksInner.java index 8b8b7ecb7cf..f7823911202 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/DisksInner.java @@ -16,6 +16,8 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.DiskUpdate; +import com.microsoft.azure.management.compute.GrantAccessData; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -44,7 +46,7 @@ * An instance of this class provides access to all the operations defined * in Disks. */ -public class DisksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class DisksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private DisksService service; /** The service client containing this operation class. */ @@ -76,11 +78,11 @@ interface DisksService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Disks update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body DiskUpdateInner disk, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body DiskUpdate disk, @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.Disks beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body DiskUpdateInner disk, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body DiskUpdate disk, @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.Disks getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}") @@ -104,11 +106,11 @@ interface DisksService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Disks grantAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess") - Observable> grantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body GrantAccessDataInner grantAccessData, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> grantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body GrantAccessData grantAccessData, @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.Disks beginGrantAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess") - Observable> beginGrantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body GrantAccessDataInner grantAccessData, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginGrantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("diskName") String diskName, @Query("api-version") String apiVersion, @Body GrantAccessData grantAccessData, @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.Disks revokeAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess") @@ -307,7 +309,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String diskName, DiskUpdateInner disk, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, diskName, disk), serviceCallback); } @@ -334,7 +336,7 @@ public ServiceFuture updateAsync(String resourceGroupName, String dis * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String diskName, DiskUpdateInner disk) { + public Observable updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { return updateWithServiceResponseAsync(resourceGroupName, diskName, disk).map(new Func1, DiskInner>() { @Override public DiskInner call(ServiceResponse response) { @@ -352,7 +354,7 @@ public DiskInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String diskName, DiskUpdateInner disk) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String diskName, DiskUpdate disk) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -382,7 +384,7 @@ public Observable> updateWithServiceResponseAsync(Str * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DiskInner object if successful. */ - public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpdateInner disk) { + public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpdate disk) { return beginUpdateWithServiceResponseAsync(resourceGroupName, diskName, disk).toBlocking().single().body(); } @@ -396,7 +398,7 @@ public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpda * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String diskName, DiskUpdateInner disk, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateAsync(String resourceGroupName, String diskName, DiskUpdate disk, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, diskName, disk), serviceCallback); } @@ -409,7 +411,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String diskName, DiskUpdateInner disk) { + public Observable beginUpdateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { return beginUpdateWithServiceResponseAsync(resourceGroupName, diskName, disk).map(new Func1, DiskInner>() { @Override public DiskInner call(ServiceResponse response) { @@ -427,7 +429,7 @@ public DiskInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String diskName, DiskUpdateInner disk) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String diskName, DiskUpdate disk) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -556,10 +558,9 @@ private ServiceResponse getByResourceGroupDelegate(Response deleteAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, diskName), serviceCallback); } @@ -583,10 +584,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String diskName) { - return deleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String diskName) { + return deleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -600,7 +601,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String diskName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -612,7 +613,7 @@ public Observable> deleteWithServi } final String apiVersion = "2018-04-01"; Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -623,10 +624,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String diskName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String diskName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().single().body(); } /** @@ -638,7 +638,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, diskName), serviceCallback); } @@ -648,12 +648,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String diskName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String diskName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -665,9 +665,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String diskName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -679,11 +679,11 @@ public Observable> beginDeleteWith } final String apiVersion = "2018-04-01"; return service.beginDelete(this.client.subscriptionId(), resourceGroupName, diskName, 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -692,9 +692,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -930,7 +930,7 @@ private ServiceResponse> listDelegate(Response grantAccessAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData, final ServiceCallback serviceCallback) { + public ServiceFuture grantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData), serviceCallback); } @@ -957,7 +957,7 @@ public ServiceFuture grantAccessAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable grantAccessAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData) { + public Observable grantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).map(new Func1, AccessUriInner>() { @Override public AccessUriInner call(ServiceResponse response) { @@ -975,7 +975,7 @@ public AccessUriInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> grantAccessWithServiceResponseAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData) { + public Observable> grantAccessWithServiceResponseAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1005,7 +1005,7 @@ public Observable> grantAccessWithServiceRespons * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AccessUriInner object if successful. */ - public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData) { + public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return beginGrantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().single().body(); } @@ -1019,7 +1019,7 @@ public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData, final ServiceCallback serviceCallback) { + public ServiceFuture beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginGrantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData), serviceCallback); } @@ -1032,7 +1032,7 @@ public ServiceFuture beginGrantAccessAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object */ - public Observable beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData) { + public Observable beginGrantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return beginGrantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).map(new Func1, AccessUriInner>() { @Override public AccessUriInner call(ServiceResponse response) { @@ -1050,7 +1050,7 @@ public AccessUriInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object */ - public Observable> beginGrantAccessWithServiceResponseAsync(String resourceGroupName, String diskName, GrantAccessDataInner grantAccessData) { + public Observable> beginGrantAccessWithServiceResponseAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1095,10 +1095,9 @@ private ServiceResponse beginGrantAccessDelegate(Response revokeAccessAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { + public ServiceFuture revokeAccessAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(revokeAccessWithServiceResponseAsync(resourceGroupName, diskName), serviceCallback); } @@ -1122,10 +1121,10 @@ public ServiceFuture revokeAccessAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable revokeAccessAsync(String resourceGroupName, String diskName) { - return revokeAccessWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, OperationStatusResponseInner>() { + public Observable revokeAccessAsync(String resourceGroupName, String diskName) { + return revokeAccessWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1139,7 +1138,7 @@ public OperationStatusResponseInner call(ServiceResponse> revokeAccessWithServiceResponseAsync(String resourceGroupName, String diskName) { + public Observable> revokeAccessWithServiceResponseAsync(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1151,7 +1150,7 @@ public Observable> revokeAccessWit } final String apiVersion = "2018-04-01"; Observable> observable = service.revokeAccess(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1162,10 +1161,9 @@ public Observable> revokeAccessWit * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, String diskName) { - return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().single().body(); + public void beginRevokeAccess(String resourceGroupName, String diskName) { + beginRevokeAccessWithServiceResponseAsync(resourceGroupName, diskName).toBlocking().single().body(); } /** @@ -1177,7 +1175,7 @@ public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRevokeAccessAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRevokeAccessAsync(String resourceGroupName, String diskName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRevokeAccessWithServiceResponseAsync(resourceGroupName, diskName), serviceCallback); } @@ -1187,12 +1185,12 @@ public ServiceFuture beginRevokeAccessAsync(String * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRevokeAccessAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRevokeAccessAsync(String resourceGroupName, String diskName) { + return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, diskName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1204,9 +1202,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRevokeAccessWithServiceResponseAsync(String resourceGroupName, String diskName) { + public Observable> beginRevokeAccessWithServiceResponseAsync(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1218,11 +1216,11 @@ public Observable> beginRevokeAcce } final String apiVersion = "2018-04-01"; return service.beginRevokeAccess(this.client.subscriptionId(), resourceGroupName, diskName, 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 = beginRevokeAccessDelegate(response); + ServiceResponse clientResponse = beginRevokeAccessDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1231,9 +1229,9 @@ public Observable> call(Response beginRevokeAccessDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRevokeAccessDelegate(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()) .registerError(CloudException.class) .build(response); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleriesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleriesInner.java new file mode 100644 index 00000000000..2f5e10d8d35 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleriesInner.java @@ -0,0 +1,949 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +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.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.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 Galleries. + */ +public class GalleriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private GalleriesService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GalleriesInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(GalleriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Galleries to be + * used by Retrofit to perform actually REST calls. + */ + interface GalleriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Galleries createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Query("api-version") String apiVersion, @Body GalleryInner gallery, @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.Galleries beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Query("api-version") String apiVersion, @Body GalleryInner gallery, @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.Galleries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @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.Galleries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @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.Galleries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @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.Galleries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.Galleries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries") + Observable> list(@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.Galleries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.Galleries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery 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 GalleryInner object if successful. + */ + public GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery).toBlocking().last().body(); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery 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 galleryName, GalleryInner gallery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery), serviceCallback); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery).map(new Func1, GalleryInner>() { + @Override + public GalleryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (gallery == null) { + throw new IllegalArgumentException("Parameter gallery is required and cannot be null."); + } + Validator.validate(gallery); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, gallery, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery 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 GalleryInner object if successful. + */ + public GalleryInner beginCreateOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery).toBlocking().single().body(); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery 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 galleryName, GalleryInner gallery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery), serviceCallback); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, gallery).map(new Func1, GalleryInner>() { + @Override + public GalleryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param gallery Parameters supplied to the create or update gallery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (gallery == null) { + throw new IllegalArgumentException("Parameter gallery is required and cannot be null."); + } + Validator.validate(gallery); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, gallery, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves information about a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 GalleryInner object if successful. + */ + public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, galleryName).toBlocking().single().body(); + } + + /** + * Retrieves information about a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 getByResourceGroupAsync(String resourceGroupName, String galleryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, galleryName), serviceCallback); + } + + /** + * Retrieves information about a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String galleryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, galleryName).map(new Func1, GalleryInner>() { + @Override + public GalleryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String galleryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 galleryName) { + deleteWithServiceResponseAsync(resourceGroupName, galleryName).toBlocking().last().body(); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 galleryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, galleryName), serviceCallback); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String galleryName) { + return deleteWithServiceResponseAsync(resourceGroupName, galleryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String galleryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 galleryName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName).toBlocking().single().body(); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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 galleryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName), serviceCallback); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String galleryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String galleryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, galleryName, 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); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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<GalleryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List galleries under a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(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); + } + + /** + * List galleries under a subscription. + * + * @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<GalleryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List galleries under a subscription. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List galleries under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List galleries under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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)); + } + }); + } + + /** + * List galleries under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), 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); + } + + /** + * List galleries under a resource group. + * + * @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<GalleryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List galleries under a resource group. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List galleries under a resource group. + * + * @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<GalleryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List galleries under a resource group. + * + * @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<GalleryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List galleries under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(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); + } + + /** + * List galleries under a subscription. + * + * @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<GalleryInner> 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(); + } + }; + } + + /** + * List galleries under a subscription. + * + * @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); + } + + /** + * List galleries under a subscription. + * + * @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<GalleryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List galleries under a subscription. + * + * @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<GalleryInner> 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)); + } + }); + } + + /** + * List galleries under a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryInner> 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/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageInner.java new file mode 100644 index 00000000000..bd9b30edb38 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageInner.java @@ -0,0 +1,336 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.compute.OperatingSystemTypes; +import com.microsoft.azure.management.compute.OperatingSystemStateTypes; +import org.joda.time.DateTime; +import com.microsoft.azure.management.compute.GalleryImageIdentifier; +import com.microsoft.azure.management.compute.RecommendedMachineConfiguration; +import com.microsoft.azure.management.compute.Disallowed; +import com.microsoft.azure.management.compute.ImagePurchasePlan; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Specifies information about the gallery image that you want to create or + * update. + */ +@JsonFlatten +public class GalleryImageInner extends Resource { + /** + * The description of this gallery image resource. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Eula agreement for the gallery image. + */ + @JsonProperty(value = "properties.eula") + private String eula; + + /** + * The privacy statement uri. + */ + @JsonProperty(value = "properties.privacyStatementUri") + private String privacyStatementUri; + + /** + * The release note uri. + */ + @JsonProperty(value = "properties.releaseNoteUri") + private String releaseNoteUri; + + /** + * This property allows you to specify the type of the OS that is included + * in the disk if creating a VM from user-image or a specialized VHD. + * <br><br> Possible values are: <br><br> + * **Windows** <br><br> **Linux**. Possible values include: + * 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType") + private OperatingSystemTypes osType; + + /** + * The OS State. Possible values include: 'Generalized', 'Specialized'. + */ + @JsonProperty(value = "properties.osState") + private OperatingSystemStateTypes osState; + + /** + * The end of life of this gallery image. + */ + @JsonProperty(value = "properties.endOfLifeDate") + private DateTime endOfLifeDate; + + /** + * The identifier property. + */ + @JsonProperty(value = "properties.identifier") + private GalleryImageIdentifier identifier; + + /** + * The recommended property. + */ + @JsonProperty(value = "properties.recommended") + private RecommendedMachineConfiguration recommended; + + /** + * The disallowed property. + */ + @JsonProperty(value = "properties.disallowed") + private Disallowed disallowed; + + /** + * The purchasePlan property. + */ + @JsonProperty(value = "properties.purchasePlan") + private ImagePurchasePlan purchasePlan; + + /** + * The current state of the gallery image. + * The provisioning state, which only appears in the response. Possible + * values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the description of this gallery image resource. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of this gallery image resource. + * + * @param description the description value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Eula agreement for the gallery image. + * + * @return the eula value + */ + public String eula() { + return this.eula; + } + + /** + * Set the Eula agreement for the gallery image. + * + * @param eula the eula value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacy statement uri. + * + * @return the privacyStatementUri value + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the release note uri. + * + * @return the releaseNoteUri value + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the OS State. Possible values include: 'Generalized', 'Specialized'. + * + * @return the osState value + */ + public OperatingSystemStateTypes osState() { + return this.osState; + } + + /** + * Set the OS State. Possible values include: 'Generalized', 'Specialized'. + * + * @param osState the osState value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOsState(OperatingSystemStateTypes osState) { + this.osState = osState; + return this; + } + + /** + * Get the end of life of this gallery image. + * + * @return the endOfLifeDate value + */ + public DateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the end of life of this gallery image. + * + * @param endOfLifeDate the endOfLifeDate value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withEndOfLifeDate(DateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the identifier value. + * + * @return the identifier value + */ + public GalleryImageIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier value. + * + * @param identifier the identifier value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withIdentifier(GalleryImageIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the recommended value. + * + * @return the recommended value + */ + public RecommendedMachineConfiguration recommended() { + return this.recommended; + } + + /** + * Set the recommended value. + * + * @param recommended the recommended value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withRecommended(RecommendedMachineConfiguration recommended) { + this.recommended = recommended; + return this; + } + + /** + * Get the disallowed value. + * + * @return the disallowed value + */ + public Disallowed disallowed() { + return this.disallowed; + } + + /** + * Set the disallowed value. + * + * @param disallowed the disallowed value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withDisallowed(Disallowed disallowed) { + this.disallowed = disallowed; + return this; + } + + /** + * Get the purchasePlan value. + * + * @return the purchasePlan value + */ + public ImagePurchasePlan purchasePlan() { + return this.purchasePlan; + } + + /** + * Set the purchasePlan value. + * + * @param purchasePlan the purchasePlan value to set + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withPurchasePlan(ImagePurchasePlan purchasePlan) { + this.purchasePlan = purchasePlan; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionInner.java new file mode 100644 index 00000000000..e6511868c23 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionInner.java @@ -0,0 +1,98 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.compute.GalleryImageVersionPublishingProfile; +import com.microsoft.azure.management.compute.GalleryImageVersionStorageProfile; +import com.microsoft.azure.management.compute.ReplicationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Specifies information about the gallery image version that you want to + * create or update. + */ +@JsonFlatten +public class GalleryImageVersionInner extends Resource { + /** + * The publishingProfile property. + */ + @JsonProperty(value = "properties.publishingProfile") + private GalleryImageVersionPublishingProfile publishingProfile; + + /** + * The current state of the gallery image version. + * The provisioning state, which only appears in the response. Possible + * values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The storageProfile property. + */ + @JsonProperty(value = "properties.storageProfile", access = JsonProperty.Access.WRITE_ONLY) + private GalleryImageVersionStorageProfile storageProfile; + + /** + * The replicationStatus property. + */ + @JsonProperty(value = "properties.replicationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationStatus replicationStatus; + + /** + * Get the publishingProfile value. + * + * @return the publishingProfile value + */ + public GalleryImageVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile value. + * + * @param publishingProfile the publishingProfile value to set + * @return the GalleryImageVersionInner object itself. + */ + public GalleryImageVersionInner withPublishingProfile(GalleryImageVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageProfile value. + * + * @return the storageProfile value + */ + public GalleryImageVersionStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Get the replicationStatus value. + * + * @return the replicationStatus value + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionsInner.java new file mode 100644 index 00000000000..13895784a60 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImageVersionsInner.java @@ -0,0 +1,905 @@ +/** + * 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.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.ReplicationStatusTypes; +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.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 GalleryImageVersions. + */ +public class GalleryImageVersionsInner { + /** The Retrofit service to perform REST calls. */ + private GalleryImageVersionsService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryImageVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GalleryImageVersionsInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(GalleryImageVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for GalleryImageVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface GalleryImageVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.GalleryImageVersions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Path("galleryImageVersionName") String galleryImageVersionName, @Query("api-version") String apiVersion, @Body GalleryImageVersionInner galleryImageVersion, @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.GalleryImageVersions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Path("galleryImageVersionName") String galleryImageVersionName, @Query("api-version") String apiVersion, @Body GalleryImageVersionInner galleryImageVersion, @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.GalleryImageVersions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Path("galleryImageVersionName") String galleryImageVersionName, @Query("$expand") ReplicationStatusTypes 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.GalleryImageVersions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Path("galleryImageVersionName") String galleryImageVersionName, @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.GalleryImageVersions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Path("galleryImageVersionName") String galleryImageVersionName, @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.GalleryImageVersions listByGalleryImage" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions") + Observable> listByGalleryImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @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.GalleryImageVersions listByGalleryImageNext" }) + @GET + Observable> listByGalleryImageNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version 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 GalleryImageVersionInner object if successful. + */ + public GalleryImageVersionInner createOrUpdate(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).toBlocking().last().body(); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version 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 galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion), serviceCallback); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).map(new Func1, GalleryImageVersionInner>() { + @Override + public GalleryImageVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + if (galleryImageVersion == null) { + throw new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null."); + } + Validator.validate(galleryImageVersion); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, apiVersion, galleryImageVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version 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 GalleryImageVersionInner object if successful. + */ + public GalleryImageVersionInner beginCreateOrUpdate(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).toBlocking().single().body(); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version 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 galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion), serviceCallback); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion).map(new Func1, GalleryImageVersionInner>() { + @Override + public GalleryImageVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> + * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + if (galleryImageVersion == null) { + throw new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null."); + } + Validator.validate(galleryImageVersion); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, apiVersion, galleryImageVersion, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 GalleryImageVersionInner object if successful. + */ + public GalleryImageVersionInner get(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).toBlocking().single().body(); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 galleryName, String galleryImageName, String galleryImageVersionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName), serviceCallback); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable getAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).map(new Func1, GalleryImageVersionInner>() { + @Override + public GalleryImageVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + final ReplicationStatusTypes expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, 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); + } + } + }); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @param expand The expand expression to apply on the operation. Possible values include: 'ReplicationStatus' + * @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 GalleryImageVersionInner object if successful. + */ + public GalleryImageVersionInner get(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).toBlocking().single().body(); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @param expand The expand expression to apply on the operation. Possible values include: 'ReplicationStatus' + * @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 galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand), serviceCallback); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @param expand The expand expression to apply on the operation. Possible values include: 'ReplicationStatus' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable getAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).map(new Func1, GalleryImageVersionInner>() { + @Override + public GalleryImageVersionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @param expand The expand expression to apply on the operation. Possible values include: 'ReplicationStatus' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageVersionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, 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); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 galleryName, String galleryImageName, String galleryImageVersionName) { + deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).toBlocking().last().body(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 galleryName, String galleryImageName, String galleryImageVersionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName), serviceCallback); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 galleryName, String galleryImageName, String galleryImageVersionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).toBlocking().single().body(); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @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 galleryName, String galleryImageName, String galleryImageVersionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName), serviceCallback); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery image version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImageVersionName The name of the gallery image version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImageVersionName == null) { + throw new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, 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); + } + + /** + * List gallery image versions under a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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<GalleryImageVersionInner> object if successful. + */ + public PagedList listByGalleryImage(final String resourceGroupName, final String galleryName, final String galleryImageName) { + ServiceResponse> response = listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByGalleryImageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List gallery image versions under a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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> listByGalleryImageAsync(final String resourceGroupName, final String galleryName, final String galleryImageName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByGalleryImageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List gallery image versions under a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageVersionInner> object + */ + public Observable> listByGalleryImageAsync(final String resourceGroupName, final String galleryName, final String galleryImageName) { + return listByGalleryImageWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List gallery image versions under a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageVersionInner> object + */ + public Observable>> listByGalleryImageWithServiceResponseAsync(final String resourceGroupName, final String galleryName, final String galleryImageName) { + return listByGalleryImageSinglePageAsync(resourceGroupName, galleryName, galleryImageName) + .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(listByGalleryImageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery image versions under a gallery image. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param galleryName The name of the gallery. + ServiceResponse> * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageVersionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByGalleryImageSinglePageAsync(final String resourceGroupName, final String galleryName, final String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByGalleryImage(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByGalleryImageDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByGalleryImageDelegate(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); + } + + /** + * List gallery image versions under a gallery image. + * + * @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<GalleryImageVersionInner> object if successful. + */ + public PagedList listByGalleryImageNext(final String nextPageLink) { + ServiceResponse> response = listByGalleryImageNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByGalleryImageNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List gallery image versions under a gallery image. + * + * @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> listByGalleryImageNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByGalleryImageNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByGalleryImageNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List gallery image versions under a gallery image. + * + * @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<GalleryImageVersionInner> object + */ + public Observable> listByGalleryImageNextAsync(final String nextPageLink) { + return listByGalleryImageNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List gallery image versions under a gallery image. + * + * @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<GalleryImageVersionInner> object + */ + public Observable>> listByGalleryImageNextWithServiceResponseAsync(final String nextPageLink) { + return listByGalleryImageNextSinglePageAsync(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(listByGalleryImageNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery image versions under a gallery image. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageVersionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByGalleryImageNextSinglePageAsync(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.listByGalleryImageNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByGalleryImageNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByGalleryImageNextDelegate(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/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImagesInner.java new file mode 100644 index 00000000000..d5bf677d9e7 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryImagesInner.java @@ -0,0 +1,765 @@ +/** + * 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.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.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.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 GalleryImages. + */ +public class GalleryImagesInner { + /** The Retrofit service to perform REST calls. */ + private GalleryImagesService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryImagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GalleryImagesInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(GalleryImagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for GalleryImages to be + * used by Retrofit to perform actually REST calls. + */ + interface GalleryImagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.GalleryImages createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Query("api-version") String apiVersion, @Body GalleryImageInner galleryImage, @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.GalleryImages beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @Query("api-version") String apiVersion, @Body GalleryImageInner galleryImage, @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.GalleryImages get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @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.GalleryImages delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @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.GalleryImages beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @Path("galleryImageName") String galleryImageName, @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.GalleryImages listByGallery" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images") + Observable> listByGallery(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("galleryName") String galleryName, @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.GalleryImages listByGalleryNext" }) + @GET + Observable> listByGalleryNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image 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 GalleryImageInner object if successful. + */ + public GalleryImageInner createOrUpdate(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).toBlocking().last().body(); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image 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 galleryName, String galleryImageName, GalleryImageInner galleryImage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage), serviceCallback); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImage == null) { + throw new IllegalArgumentException("Parameter galleryImage is required and cannot be null."); + } + Validator.validate(galleryImage); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, apiVersion, galleryImage, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image 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 GalleryImageInner object if successful. + */ + public GalleryImageInner beginCreateOrUpdate(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).toBlocking().single().body(); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image 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 galleryName, String galleryImageName, GalleryImageInner galleryImage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage), serviceCallback); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @param galleryImage Parameters supplied to the create or update gallery image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImage == null) { + throw new IllegalArgumentException("Parameter galleryImage is required and cannot be null."); + } + Validator.validate(galleryImage); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, apiVersion, galleryImage, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieves information about a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 GalleryImageInner object if successful. + */ + public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).toBlocking().single().body(); + } + + /** + * Retrieves information about a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 galleryName, String galleryImageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName), serviceCallback); + } + + /** + * Retrieves information about a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageInner object + */ + public Observable getAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GalleryImageInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, 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); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 galleryName, String galleryImageName) { + deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).toBlocking().last().body(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 galleryName, String galleryImageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName), serviceCallback); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return deleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 galleryName, String galleryImageName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).toBlocking().single().body(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @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 galleryName, String galleryImageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName), serviceCallback); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, galleryName, galleryImageName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @param galleryImageName The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String galleryName, String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, galleryName, galleryImageName, 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); + } + + /** + * List gallery images under a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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<GalleryImageInner> object if successful. + */ + public PagedList listByGallery(final String resourceGroupName, final String galleryName) { + ServiceResponse> response = listByGallerySinglePageAsync(resourceGroupName, galleryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByGalleryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List gallery images under a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @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> listByGalleryAsync(final String resourceGroupName, final String galleryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByGallerySinglePageAsync(resourceGroupName, galleryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByGalleryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List gallery images under a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable> listByGalleryAsync(final String resourceGroupName, final String galleryName) { + return listByGalleryWithServiceResponseAsync(resourceGroupName, galleryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List gallery images under a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable>> listByGalleryWithServiceResponseAsync(final String resourceGroupName, final String galleryName) { + return listByGallerySinglePageAsync(resourceGroupName, galleryName) + .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(listByGalleryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery images under a gallery. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param galleryName The name of the gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByGallerySinglePageAsync(final String resourceGroupName, final String galleryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (galleryName == null) { + throw new IllegalArgumentException("Parameter galleryName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.listByGallery(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByGalleryDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByGalleryDelegate(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); + } + + /** + * List gallery images under a gallery. + * + * @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<GalleryImageInner> object if successful. + */ + public PagedList listByGalleryNext(final String nextPageLink) { + ServiceResponse> response = listByGalleryNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByGalleryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List gallery images under a gallery. + * + * @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> listByGalleryNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByGalleryNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByGalleryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List gallery images under a gallery. + * + * @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<GalleryImageInner> object + */ + public Observable> listByGalleryNextAsync(final String nextPageLink) { + return listByGalleryNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List gallery images under a gallery. + * + * @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<GalleryImageInner> object + */ + public Observable>> listByGalleryNextWithServiceResponseAsync(final String nextPageLink) { + return listByGalleryNextSinglePageAsync(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(listByGalleryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery images under a gallery. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByGalleryNextSinglePageAsync(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.listByGalleryNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByGalleryNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByGalleryNextDelegate(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/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryInner.java new file mode 100644 index 00000000000..b1ea9939827 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/GalleryInner.java @@ -0,0 +1,91 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.compute.GalleryIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Specifies information about the gallery that you want to create or update. + */ +@JsonFlatten +public class GalleryInner extends Resource { + /** + * The description of this gallery resource. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The identifier property. + */ + @JsonProperty(value = "properties.identifier") + private GalleryIdentifier identifier; + + /** + * The current state of the gallery. + * The provisioning state, which only appears in the response. Possible + * values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + * 'Deleting', 'Migrating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the description of this gallery resource. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of this gallery resource. + * + * @param description the description value to set + * @return the GalleryInner object itself. + */ + public GalleryInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the identifier value. + * + * @return the identifier value + */ + public GalleryIdentifier identifier() { + return this.identifier; + } + + /** + * Set the identifier value. + * + * @param identifier the identifier value to set + * @return the GalleryInner object itself. + */ + public GalleryInner withIdentifier(GalleryIdentifier identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating'. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageInner.java index 4662339b5ed..bf47794fae3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageInner.java @@ -40,7 +40,7 @@ public class ImageInner extends Resource { private String provisioningState; /** - * Get the sourceVirtualMachine value. + * Get the source virtual machine from which Image is created. * * @return the sourceVirtualMachine value */ @@ -49,7 +49,7 @@ public SubResource sourceVirtualMachine() { } /** - * Set the sourceVirtualMachine value. + * Set the source virtual machine from which Image is created. * * @param sourceVirtualMachine the sourceVirtualMachine value to set * @return the ImageInner object itself. @@ -60,7 +60,7 @@ public ImageInner withSourceVirtualMachine(SubResource sourceVirtualMachine) { } /** - * Get the storageProfile value. + * Get specifies the storage settings for the virtual machine disks. * * @return the storageProfile value */ @@ -69,7 +69,7 @@ public ImageStorageProfile storageProfile() { } /** - * Set the storageProfile value. + * Set specifies the storage settings for the virtual machine disks. * * @param storageProfile the storageProfile value to set * @return the ImageInner object itself. @@ -80,7 +80,7 @@ public ImageInner withStorageProfile(ImageStorageProfile storageProfile) { } /** - * Get the provisioningState value. + * Get the provisioning state. * * @return the provisioningState value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageReferenceInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageReferenceInner.java deleted file mode 100644 index 7ec601feaac..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImageReferenceInner.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * 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.implementation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.SubResource; - -/** - * Specifies information about the image to use. You can specify information - * about platform images, marketplace images, or virtual machine images. This - * element is required when you want to use a platform image, marketplace - * image, or virtual machine image, but is not used in other creation - * operations. - */ -public class ImageReferenceInner extends SubResource { - /** - * The image publisher. - */ - @JsonProperty(value = "publisher") - private String publisher; - - /** - * Specifies the offer of the platform image or marketplace image used to - * create the virtual machine. - */ - @JsonProperty(value = "offer") - private String offer; - - /** - * The image SKU. - */ - @JsonProperty(value = "sku") - private String sku; - - /** - * Specifies the version of the platform image or marketplace image used to - * create the virtual machine. The allowed formats are Major.Minor.Build or - * 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' - * to use the latest version of an image available at deploy time. Even if - * you use 'latest', the VM image will not automatically update after - * deploy time even if a new version becomes available. - */ - @JsonProperty(value = "version") - private String version; - - /** - * Get the publisher value. - * - * @return the publisher value - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher value. - * - * @param publisher the publisher value to set - * @return the ImageReferenceInner object itself. - */ - public ImageReferenceInner withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the offer value. - * - * @return the offer value - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer value. - * - * @param offer the offer value to set - * @return the ImageReferenceInner object itself. - */ - public ImageReferenceInner withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the sku value. - * - * @return the sku value - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku value. - * - * @param sku the sku value to set - * @return the ImageReferenceInner object itself. - */ - public ImageReferenceInner withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Get the version value. - * - * @return the version value - */ - public String version() { - return this.version; - } - - /** - * Set the version value. - * - * @param version the version value to set - * @return the ImageReferenceInner object itself. - */ - public ImageReferenceInner withVersion(String version) { - this.version = version; - return this; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImagesInner.java index 9c65769dfac..85d937aca57 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ImagesInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.ImageUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -30,6 +31,7 @@ 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; @@ -42,7 +44,7 @@ * An instance of this class provides access to all the operations defined * in Images. */ -public class ImagesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class ImagesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private ImagesService service; /** The service client containing this operation class. */ @@ -72,6 +74,14 @@ interface ImagesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}") Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("imageName") String imageName, @Path("subscriptionId") String subscriptionId, @Body ImageInner parameters, @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.Images update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("imageName") String imageName, @Path("subscriptionId") String subscriptionId, @Body ImageUpdate parameters, @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.Images beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("imageName") String imageName, @Path("subscriptionId") String subscriptionId, @Body ImageUpdate parameters, @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.Images delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("imageName") String imageName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -172,7 +182,7 @@ public Observable> createOrUpdateWithServiceResponse throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, imageName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -247,7 +257,7 @@ public Observable> beginCreateOrUpdateWithServiceRes throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCreateOrUpdate(resourceGroupName, imageName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -270,6 +280,174 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, imageName, parameters), serviceCallback); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, imageName, parameters).map(new Func1, ImageInner>() { + @Override + public ImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (imageName == null) { + throw new IllegalArgumentException("Parameter imageName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.update(resourceGroupName, imageName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image 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 ImageInner object if successful. + */ + public ImageInner beginUpdate(String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, imageName, parameters).toBlocking().single().body(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image 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 imageName, ImageUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, imageName, parameters), serviceCallback); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, imageName, parameters).map(new Func1, ImageInner>() { + @Override + public ImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters Parameters supplied to the Update Image operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImageInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (imageName == null) { + throw new IllegalArgumentException("Parameter imageName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginUpdate(resourceGroupName, imageName, this.client.subscriptionId(), parameters, 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()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Deletes an Image. * @@ -278,10 +456,9 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String imageName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String imageName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, imageName), serviceCallback); } @@ -305,10 +482,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String imageName) { - return deleteWithServiceResponseAsync(resourceGroupName, imageName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String imageName) { + return deleteWithServiceResponseAsync(resourceGroupName, imageName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -322,7 +499,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String imageName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String imageName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -332,9 +509,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, imageName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -345,10 +522,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String imageName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, imageName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String imageName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, imageName).toBlocking().single().body(); } /** @@ -360,7 +536,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String imageName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String imageName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, imageName), serviceCallback); } @@ -370,12 +546,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param resourceGroupName The name of the resource group. * @param imageName The name of the image. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String imageName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, imageName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String imageName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, imageName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -387,9 +563,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String imageName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String imageName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -399,13 +575,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, imageName, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -414,9 +590,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -485,7 +661,7 @@ public Observable> getByResourceGroupWithServiceResp if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String expand = null; return service.getByResourceGroup(resourceGroupName, imageName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -567,7 +743,7 @@ public Observable> getByResourceGroupWithServiceResp if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getByResourceGroup(resourceGroupName, imageName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -680,7 +856,7 @@ public Observable>> listByResourceGroupSinglePa if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -785,7 +961,7 @@ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsInner.java index 652a8ced8a2..d5c12ccdc01 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsInner.java @@ -11,6 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.compute.RequestRateByIntervalInput; +import com.microsoft.azure.management.compute.ThrottledRequestsInput; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -26,6 +28,8 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -55,19 +59,19 @@ public LogAnalyticsInner(Retrofit retrofit, ComputeManagementClientImpl client) interface LogAnalyticsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.LogAnalytics exportRequestRateByInterval" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval") - Observable> exportRequestRateByInterval(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body RequestRateByIntervalInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> exportRequestRateByInterval(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body RequestRateByIntervalInput parameters, @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.LogAnalytics beginExportRequestRateByInterval" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval") - Observable> beginExportRequestRateByInterval(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body RequestRateByIntervalInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginExportRequestRateByInterval(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body RequestRateByIntervalInput parameters, @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.LogAnalytics exportThrottledRequests" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests") - Observable> exportThrottledRequests(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body ThrottledRequestsInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> exportThrottledRequests(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body ThrottledRequestsInput parameters, @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.LogAnalytics beginExportThrottledRequests" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests") - Observable> beginExportThrottledRequests(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body ThrottledRequestsInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginExportThrottledRequests(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body ThrottledRequestsInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -81,7 +85,7 @@ interface LogAnalyticsService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LogAnalyticsOperationResultInner object if successful. */ - public LogAnalyticsOperationResultInner exportRequestRateByInterval(String location, RequestRateByIntervalInputInner parameters) { + public LogAnalyticsOperationResultInner exportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { return exportRequestRateByIntervalWithServiceResponseAsync(location, parameters).toBlocking().last().body(); } @@ -94,7 +98,7 @@ public LogAnalyticsOperationResultInner exportRequestRateByInterval(String locat * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(exportRequestRateByIntervalWithServiceResponseAsync(location, parameters), serviceCallback); } @@ -106,7 +110,7 @@ public ServiceFuture exportRequestRateByInterv * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters) { + public Observable exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { return exportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse response) { @@ -123,7 +127,7 @@ public LogAnalyticsOperationResultInner call(ServiceResponse> exportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInputInner parameters) { + public Observable> exportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInput parameters) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -134,9 +138,9 @@ public Observable> exportReque throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.exportRequestRateByInterval(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); } /** @@ -149,7 +153,7 @@ public Observable> exportReque * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LogAnalyticsOperationResultInner object if successful. */ - public LogAnalyticsOperationResultInner beginExportRequestRateByInterval(String location, RequestRateByIntervalInputInner parameters) { + public LogAnalyticsOperationResultInner beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).toBlocking().single().body(); } @@ -162,7 +166,7 @@ public LogAnalyticsOperationResultInner beginExportRequestRateByInterval(String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters), serviceCallback); } @@ -174,7 +178,7 @@ public ServiceFuture beginExportRequestRateByI * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LogAnalyticsOperationResultInner object */ - public Observable beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters) { + public Observable beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse response) { @@ -191,7 +195,7 @@ public LogAnalyticsOperationResultInner call(ServiceResponse> beginExportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInputInner parameters) { + public Observable> beginExportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInput parameters) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -202,7 +206,7 @@ public Observable> beginExport throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginExportRequestRateByInterval(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -235,7 +239,7 @@ private ServiceResponse beginExportRequestRate * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LogAnalyticsOperationResultInner object if successful. */ - public LogAnalyticsOperationResultInner exportThrottledRequests(String location, ThrottledRequestsInputInner parameters) { + public LogAnalyticsOperationResultInner exportThrottledRequests(String location, ThrottledRequestsInput parameters) { return exportThrottledRequestsWithServiceResponseAsync(location, parameters).toBlocking().last().body(); } @@ -248,7 +252,7 @@ public LogAnalyticsOperationResultInner exportThrottledRequests(String location, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture exportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture exportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(exportThrottledRequestsWithServiceResponseAsync(location, parameters), serviceCallback); } @@ -260,7 +264,7 @@ public ServiceFuture exportThrottledRequestsAs * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable exportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters) { + public Observable exportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters) { return exportThrottledRequestsWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse response) { @@ -277,7 +281,7 @@ public LogAnalyticsOperationResultInner call(ServiceResponse> exportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInputInner parameters) { + public Observable> exportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInput parameters) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -288,9 +292,9 @@ public Observable> exportThrot throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.exportThrottledRequests(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); } /** @@ -303,7 +307,7 @@ public Observable> exportThrot * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LogAnalyticsOperationResultInner object if successful. */ - public LogAnalyticsOperationResultInner beginExportThrottledRequests(String location, ThrottledRequestsInputInner parameters) { + public LogAnalyticsOperationResultInner beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) { return beginExportThrottledRequestsWithServiceResponseAsync(location, parameters).toBlocking().single().body(); } @@ -316,7 +320,7 @@ public LogAnalyticsOperationResultInner beginExportThrottledRequests(String loca * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginExportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginExportThrottledRequestsWithServiceResponseAsync(location, parameters), serviceCallback); } @@ -328,7 +332,7 @@ public ServiceFuture beginExportThrottledReque * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LogAnalyticsOperationResultInner object */ - public Observable beginExportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters) { + public Observable beginExportThrottledRequestsAsync(String location, ThrottledRequestsInput parameters) { return beginExportThrottledRequestsWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { @Override public LogAnalyticsOperationResultInner call(ServiceResponse response) { @@ -345,7 +349,7 @@ public LogAnalyticsOperationResultInner call(ServiceResponse> beginExportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInputInner parameters) { + public Observable> beginExportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInput parameters) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -356,7 +360,7 @@ public Observable> beginExport throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginExportThrottledRequests(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java index 8dd8065900d..46707892610 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java @@ -14,7 +14,7 @@ /** * LogAnalytics operation status response. */ -public class LogAnalyticsOperationResultInner extends OperationStatusResponseInner { +public class LogAnalyticsOperationResultInner { /** * LogAnalyticsOutput. */ @@ -22,7 +22,7 @@ public class LogAnalyticsOperationResultInner extends OperationStatusResponseInn private LogAnalyticsOutput properties; /** - * Get the properties value. + * Get logAnalyticsOutput. * * @return the properties value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationStatusResponseInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationStatusResponseInner.java deleted file mode 100644 index 63e91c0d146..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationStatusResponseInner.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * 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.implementation; - -import org.joda.time.DateTime; -import com.microsoft.azure.management.compute.ApiError; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Operation status response. - */ -public class OperationStatusResponseInner { - /** - * Operation ID. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Operation status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** - * Start time of the operation. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private DateTime startTime; - - /** - * End time of the operation. - */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) - private DateTime endTime; - - /** - * Api error. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ApiError error; - - /** - * Get the name value. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Get the status value. - * - * @return the status value - */ - public String status() { - return this.status; - } - - /** - * Get the startTime value. - * - * @return the startTime value - */ - public DateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime value. - * - * @return the endTime value - */ - public DateTime endTime() { - return this.endTime; - } - - /** - * Get the error value. - * - * @return the error value - */ - public ApiError error() { - return this.error; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationsInner.java new file mode 100644 index 00000000000..b6a62cb0005 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/OperationsInner.java @@ -0,0 +1,132 @@ +/** + * 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.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Operations list" }) + @GET("providers/Microsoft.Compute/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of compute operations. + * + * @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 List<ComputeOperationValueInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets a list of compute operations. + * + * @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 ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets a list of compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ComputeOperationValueInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ComputeOperationValueInner> object + */ + public Observable>> listWithServiceResponseAsync() { + final String apiVersion = "2018-06-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RecoveryWalkResponseInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RecoveryWalkResponseInner.java index 1d2655887c0..76acea3a38f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RecoveryWalkResponseInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RecoveryWalkResponseInner.java @@ -28,7 +28,7 @@ public class RecoveryWalkResponseInner { private Integer nextPlatformUpdateDomain; /** - * Get the walkPerformed value. + * Get whether the recovery walk was performed. * * @return the walkPerformed value */ @@ -37,7 +37,7 @@ public Boolean walkPerformed() { } /** - * Get the nextPlatformUpdateDomain value. + * Get the next update domain that needs to be walked. Null means walk spanning all update domains has been completed. * * @return the nextPlatformUpdateDomain value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ResourceSkuInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ResourceSkuInner.java index 7635321cb74..3227cb45746 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ResourceSkuInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ResourceSkuInner.java @@ -103,7 +103,7 @@ public class ResourceSkuInner { private List restrictions; /** - * Get the resourceType value. + * Get the type of resource the SKU applies to. * * @return the resourceType value */ @@ -112,7 +112,7 @@ public String resourceType() { } /** - * Get the name value. + * Get the name of SKU. * * @return the name value */ @@ -121,7 +121,7 @@ public String name() { } /** - * Get the tier value. + * Get specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**. * * @return the tier value */ @@ -130,7 +130,7 @@ public String tier() { } /** - * Get the size value. + * Get the Size of the SKU. * * @return the size value */ @@ -139,7 +139,7 @@ public String size() { } /** - * Get the family value. + * Get the Family of this particular SKU. * * @return the family value */ @@ -148,7 +148,7 @@ public String family() { } /** - * Get the kind value. + * Get the Kind of resources that are supported in this SKU. * * @return the kind value */ @@ -157,7 +157,7 @@ public String kind() { } /** - * Get the capacity value. + * Get specifies the number of virtual machines in the scale set. * * @return the capacity value */ @@ -166,7 +166,7 @@ public ResourceSkuCapacity capacity() { } /** - * Get the locations value. + * Get the set of locations that the SKU is available. * * @return the locations value */ @@ -175,7 +175,7 @@ public List locations() { } /** - * Get the locationInfo value. + * Get a list of locations and availability zones in those locations where the SKU is available. * * @return the locationInfo value */ @@ -184,7 +184,7 @@ public List locationInfo() { } /** - * Get the apiVersions value. + * Get the api versions that support this SKU. * * @return the apiVersions value */ @@ -193,7 +193,7 @@ public List apiVersions() { } /** - * Get the costs value. + * Get metadata for retrieving price info. * * @return the costs value */ @@ -202,7 +202,7 @@ public List costs() { } /** - * Get the capabilities value. + * Get a name value pair to describe the capability. * * @return the capabilities value */ @@ -211,7 +211,7 @@ public List capabilities() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RollingUpgradeStatusInfoInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RollingUpgradeStatusInfoInner.java index 433da4122a0..4e401fe7757 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RollingUpgradeStatusInfoInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RollingUpgradeStatusInfoInner.java @@ -47,7 +47,7 @@ public class RollingUpgradeStatusInfoInner extends Resource { private ApiError error; /** - * Get the policy value. + * Get the rolling upgrade policies applied for this upgrade. * * @return the policy value */ @@ -56,7 +56,7 @@ public RollingUpgradePolicy policy() { } /** - * Get the runningStatus value. + * Get information about the current running state of the overall upgrade. * * @return the runningStatus value */ @@ -65,7 +65,7 @@ public RollingUpgradeRunningStatus runningStatus() { } /** - * Get the progress value. + * Get information about the number of virtual machine instances in each upgrade state. * * @return the progress value */ @@ -74,7 +74,7 @@ public RollingUpgradeProgressInfo progress() { } /** - * Get the error value. + * Get error details for this upgrade, if there are any. * * @return the error value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentBaseInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentBaseInner.java index 80c586b0cfd..d5261f10412 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentBaseInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentBaseInner.java @@ -46,7 +46,7 @@ public class RunCommandDocumentBaseInner { private String description; /** - * Get the schema value. + * Get the VM run command schema. * * @return the schema value */ @@ -55,7 +55,7 @@ public String schema() { } /** - * Set the schema value. + * Set the VM run command schema. * * @param schema the schema value to set * @return the RunCommandDocumentBaseInner object itself. @@ -66,7 +66,7 @@ public RunCommandDocumentBaseInner withSchema(String schema) { } /** - * Get the id value. + * Get the VM run command id. * * @return the id value */ @@ -75,7 +75,7 @@ public String id() { } /** - * Set the id value. + * Set the VM run command id. * * @param id the id value to set * @return the RunCommandDocumentBaseInner object itself. @@ -86,7 +86,7 @@ public RunCommandDocumentBaseInner withId(String id) { } /** - * Get the osType value. + * Get the Operating System type. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -95,7 +95,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set the Operating System type. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the RunCommandDocumentBaseInner object itself. @@ -106,7 +106,7 @@ public RunCommandDocumentBaseInner withOsType(OperatingSystemTypes osType) { } /** - * Get the label value. + * Get the VM run command label. * * @return the label value */ @@ -115,7 +115,7 @@ public String label() { } /** - * Set the label value. + * Set the VM run command label. * * @param label the label value to set * @return the RunCommandDocumentBaseInner object itself. @@ -126,7 +126,7 @@ public RunCommandDocumentBaseInner withLabel(String label) { } /** - * Get the description value. + * Get the VM run command description. * * @return the description value */ @@ -135,7 +135,7 @@ public String description() { } /** - * Set the description value. + * Set the VM run command description. * * @param description the description value to set * @return the RunCommandDocumentBaseInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentInner.java index c7c5af6f28e..a8b06b0d60d 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RunCommandDocumentInner.java @@ -29,7 +29,7 @@ public class RunCommandDocumentInner extends RunCommandDocumentBaseInner { private List parameters; /** - * Get the script value. + * Get the script to be executed. * * @return the script value */ @@ -38,7 +38,7 @@ public List script() { } /** - * Set the script value. + * Set the script to be executed. * * @param script the script value to set * @return the RunCommandDocumentInner object itself. @@ -49,7 +49,7 @@ public RunCommandDocumentInner withScript(List script) { } /** - * Get the parameters value. + * Get the parameters used by the script. * * @return the parameters value */ @@ -58,7 +58,7 @@ public List parameters() { } /** - * Set the parameters value. + * Set the parameters used by the script. * * @param parameters the parameters value to set * @return the RunCommandDocumentInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotImpl.java index b0378cedbc6..b0df4c357bf 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.compute.DiskCreateOption; import com.microsoft.azure.management.compute.CreationSource; import com.microsoft.azure.management.compute.DiskSkuTypes; +import com.microsoft.azure.management.compute.GrantAccessData; import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.Snapshot; import com.microsoft.azure.management.compute.SnapshotSku; @@ -94,7 +95,7 @@ public String grantAccess(int accessDurationInSeconds) { @Override public Observable grantAccessAsync(int accessDurationInSeconds) { - GrantAccessDataInner grantAccessDataInner = new GrantAccessDataInner(); + GrantAccessData grantAccessDataInner = new GrantAccessData(); grantAccessDataInner.withAccess(AccessLevel.READ) .withDurationInSeconds(accessDurationInSeconds); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotInner.java index 851559f1d20..8fb631216b3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotInner.java @@ -76,7 +76,7 @@ public class SnapshotInner extends Resource { private String provisioningState; /** - * Get the managedBy value. + * Get unused. Always Null. * * @return the managedBy value */ @@ -105,7 +105,7 @@ public SnapshotInner withSku(SnapshotSku sku) { } /** - * Get the timeCreated value. + * Get the time when the disk was created. * * @return the timeCreated value */ @@ -114,7 +114,7 @@ public DateTime timeCreated() { } /** - * Get the osType value. + * Get the Operating System type. Possible values include: 'Windows', 'Linux'. * * @return the osType value */ @@ -123,7 +123,7 @@ public OperatingSystemTypes osType() { } /** - * Set the osType value. + * Set the Operating System type. Possible values include: 'Windows', 'Linux'. * * @param osType the osType value to set * @return the SnapshotInner object itself. @@ -134,7 +134,7 @@ public SnapshotInner withOsType(OperatingSystemTypes osType) { } /** - * Get the creationData value. + * Get disk source information. CreationData information cannot be changed after the disk has been created. * * @return the creationData value */ @@ -143,7 +143,7 @@ public CreationData creationData() { } /** - * Set the creationData value. + * Set disk source information. CreationData information cannot be changed after the disk has been created. * * @param creationData the creationData value to set * @return the SnapshotInner object itself. @@ -154,7 +154,7 @@ public SnapshotInner withCreationData(CreationData creationData) { } /** - * Get the diskSizeGB value. + * Get if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. * * @return the diskSizeGB value */ @@ -163,7 +163,7 @@ public Integer diskSizeGB() { } /** - * Set the diskSizeGB value. + * Set if creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. * * @param diskSizeGB the diskSizeGB value to set * @return the SnapshotInner object itself. @@ -174,7 +174,7 @@ public SnapshotInner withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the encryptionSettings value. + * Get encryption settings for disk or snapshot. * * @return the encryptionSettings value */ @@ -183,7 +183,7 @@ public EncryptionSettings encryptionSettings() { } /** - * Set the encryptionSettings value. + * Set encryption settings for disk or snapshot. * * @param encryptionSettings the encryptionSettings value to set * @return the SnapshotInner object itself. @@ -194,7 +194,7 @@ public SnapshotInner withEncryptionSettings(EncryptionSettings encryptionSetting } /** - * Get the provisioningState value. + * Get the disk provisioning state. * * @return the provisioningState value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotUpdateInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotUpdateInner.java deleted file mode 100644 index 6348445759b..00000000000 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotUpdateInner.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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.implementation; - -import com.microsoft.azure.management.compute.OperatingSystemTypes; -import com.microsoft.azure.management.compute.EncryptionSettings; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; -import com.microsoft.azure.management.compute.ResourceUpdate; - -/** - * Snapshot update resource. - */ -@JsonFlatten -public class SnapshotUpdateInner extends ResourceUpdate { - /** - * the Operating System type. Possible values include: 'Windows', 'Linux'. - */ - @JsonProperty(value = "properties.osType") - private OperatingSystemTypes osType; - - /** - * If creationData.createOption is Empty, this field is mandatory and it - * indicates the size of the VHD to create. If this field is present for - * updates or creation with other options, it indicates a resize. Resizes - * are only allowed if the disk is not attached to a running VM, and can - * only increase the disk's size. - */ - @JsonProperty(value = "properties.diskSizeGB") - private Integer diskSizeGB; - - /** - * Encryption settings for disk or snapshot. - */ - @JsonProperty(value = "properties.encryptionSettings") - private EncryptionSettings encryptionSettings; - - /** - * Get the osType value. - * - * @return the osType value - */ - public OperatingSystemTypes osType() { - return this.osType; - } - - /** - * Set the osType value. - * - * @param osType the osType value to set - * @return the SnapshotUpdateInner object itself. - */ - public SnapshotUpdateInner withOsType(OperatingSystemTypes osType) { - this.osType = osType; - return this; - } - - /** - * Get the diskSizeGB value. - * - * @return the diskSizeGB value - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB value. - * - * @param diskSizeGB the diskSizeGB value to set - * @return the SnapshotUpdateInner object itself. - */ - public SnapshotUpdateInner withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the encryptionSettings value. - * - * @return the encryptionSettings value - */ - public EncryptionSettings encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings value. - * - * @param encryptionSettings the encryptionSettings value to set - * @return the SnapshotUpdateInner object itself. - */ - public SnapshotUpdateInner withEncryptionSettings(EncryptionSettings encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - -} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsImpl.java index a8bc47eff9e..b08a0e6c8b6 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsImpl.java @@ -8,6 +8,7 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.compute.AccessLevel; +import com.microsoft.azure.management.compute.GrantAccessData; import com.microsoft.azure.management.compute.Snapshot; import com.microsoft.azure.management.compute.Snapshots; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; @@ -36,7 +37,7 @@ class SnapshotsImpl @Override public Observable grantAccessAsync(String resourceGroupName, String snapshotName, AccessLevel accessLevel, int accessDuration) { - GrantAccessDataInner grantAccessDataInner = new GrantAccessDataInner(); + GrantAccessData grantAccessDataInner = new GrantAccessData(); grantAccessDataInner.withAccess(accessLevel) .withDurationInSeconds(accessDuration); return this.inner().grantAccessAsync(resourceGroupName, snapshotName, grantAccessDataInner) diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsInner.java index 3e8637ef477..c2cf34357fc 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/SnapshotsInner.java @@ -16,6 +16,8 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.GrantAccessData; +import com.microsoft.azure.management.compute.SnapshotUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -44,7 +46,7 @@ * An instance of this class provides access to all the operations defined * in Snapshots. */ -public class SnapshotsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class SnapshotsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private SnapshotsService service; /** The service client containing this operation class. */ @@ -76,11 +78,11 @@ interface SnapshotsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Snapshots update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body SnapshotUpdateInner snapshot, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body SnapshotUpdate snapshot, @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.Snapshots beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body SnapshotUpdateInner snapshot, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body SnapshotUpdate snapshot, @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.Snapshots getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}") @@ -104,11 +106,11 @@ interface SnapshotsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.Snapshots grantAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess") - Observable> grantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body GrantAccessDataInner grantAccessData, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> grantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body GrantAccessData grantAccessData, @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.Snapshots beginGrantAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess") - Observable> beginGrantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body GrantAccessDataInner grantAccessData, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginGrantAccess(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Body GrantAccessData grantAccessData, @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.Snapshots revokeAccess" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess") @@ -307,7 +309,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot), serviceCallback); } @@ -334,7 +336,7 @@ public ServiceFuture updateAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot) { + public Observable updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { return updateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1, SnapshotInner>() { @Override public SnapshotInner call(ServiceResponse response) { @@ -352,7 +354,7 @@ public SnapshotInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -382,7 +384,7 @@ public Observable> updateWithServiceResponseAsync * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SnapshotInner object if successful. */ - public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot) { + public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { return beginUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).toBlocking().single().body(); } @@ -396,7 +398,7 @@ public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot), serviceCallback); } @@ -409,7 +411,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot) { + public Observable beginUpdateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { return beginUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1, SnapshotInner>() { @Override public SnapshotInner call(ServiceResponse response) { @@ -427,7 +429,7 @@ public SnapshotInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String snapshotName, SnapshotUpdateInner snapshot) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -556,10 +558,9 @@ private ServiceResponse getByResourceGroupDelegate(Response deleteAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, snapshotName), serviceCallback); } @@ -583,10 +584,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String snapshotName) { - return deleteWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String snapshotName) { + return deleteWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -600,7 +601,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String snapshotName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String snapshotName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -612,7 +613,7 @@ public Observable> deleteWithServi } final String apiVersion = "2018-04-01"; Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -623,10 +624,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String snapshotName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, snapshotName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String snapshotName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, snapshotName).toBlocking().single().body(); } /** @@ -638,7 +638,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, snapshotName), serviceCallback); } @@ -648,12 +648,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String snapshotName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String snapshotName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -665,9 +665,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String snapshotName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String snapshotName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -679,11 +679,11 @@ public Observable> beginDeleteWith } final String apiVersion = "2018-04-01"; return service.beginDelete(this.client.subscriptionId(), resourceGroupName, snapshotName, 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -692,9 +692,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -930,7 +930,7 @@ private ServiceResponse> listDelegate(Response grantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData, final ServiceCallback serviceCallback) { + public ServiceFuture grantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(grantAccessWithServiceResponseAsync(resourceGroupName, snapshotName, grantAccessData), serviceCallback); } @@ -957,7 +957,7 @@ public ServiceFuture grantAccessAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable grantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData) { + public Observable grantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { return grantAccessWithServiceResponseAsync(resourceGroupName, snapshotName, grantAccessData).map(new Func1, AccessUriInner>() { @Override public AccessUriInner call(ServiceResponse response) { @@ -975,7 +975,7 @@ public AccessUriInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> grantAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData) { + public Observable> grantAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1005,7 +1005,7 @@ public Observable> grantAccessWithServiceRespons * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AccessUriInner object if successful. */ - public AccessUriInner beginGrantAccess(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData) { + public AccessUriInner beginGrantAccess(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { return beginGrantAccessWithServiceResponseAsync(resourceGroupName, snapshotName, grantAccessData).toBlocking().single().body(); } @@ -1019,7 +1019,7 @@ public AccessUriInner beginGrantAccess(String resourceGroupName, String snapshot * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginGrantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData, final ServiceCallback serviceCallback) { + public ServiceFuture beginGrantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginGrantAccessWithServiceResponseAsync(resourceGroupName, snapshotName, grantAccessData), serviceCallback); } @@ -1032,7 +1032,7 @@ public ServiceFuture beginGrantAccessAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object */ - public Observable beginGrantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData) { + public Observable beginGrantAccessAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { return beginGrantAccessWithServiceResponseAsync(resourceGroupName, snapshotName, grantAccessData).map(new Func1, AccessUriInner>() { @Override public AccessUriInner call(ServiceResponse response) { @@ -1050,7 +1050,7 @@ public AccessUriInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object */ - public Observable> beginGrantAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName, GrantAccessDataInner grantAccessData) { + public Observable> beginGrantAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1095,10 +1095,9 @@ private ServiceResponse beginGrantAccessDelegate(Response revokeAccessAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { + public ServiceFuture revokeAccessAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(revokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName), serviceCallback); } @@ -1122,10 +1121,10 @@ public ServiceFuture revokeAccessAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable revokeAccessAsync(String resourceGroupName, String snapshotName) { - return revokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, OperationStatusResponseInner>() { + public Observable revokeAccessAsync(String resourceGroupName, String snapshotName) { + return revokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1139,7 +1138,7 @@ public OperationStatusResponseInner call(ServiceResponse> revokeAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName) { + public Observable> revokeAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1151,7 +1150,7 @@ public Observable> revokeAccessWit } final String apiVersion = "2018-04-01"; Observable> observable = service.revokeAccess(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1162,10 +1161,9 @@ public Observable> revokeAccessWit * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, String snapshotName) { - return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).toBlocking().single().body(); + public void beginRevokeAccess(String resourceGroupName, String snapshotName) { + beginRevokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).toBlocking().single().body(); } /** @@ -1177,7 +1175,7 @@ public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRevokeAccessAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRevokeAccessAsync(String resourceGroupName, String snapshotName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRevokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName), serviceCallback); } @@ -1187,12 +1185,12 @@ public ServiceFuture beginRevokeAccessAsync(String * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRevokeAccessAsync(String resourceGroupName, String snapshotName) { - return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRevokeAccessAsync(String resourceGroupName, String snapshotName) { + return beginRevokeAccessWithServiceResponseAsync(resourceGroupName, snapshotName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1204,9 +1202,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRevokeAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName) { + public Observable> beginRevokeAccessWithServiceResponseAsync(String resourceGroupName, String snapshotName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1218,11 +1216,11 @@ public Observable> beginRevokeAcce } final String apiVersion = "2018-04-01"; return service.beginRevokeAccess(this.client.subscriptionId(), resourceGroupName, snapshotName, 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 = beginRevokeAccessDelegate(response); + ServiceResponse clientResponse = beginRevokeAccessDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1231,9 +1229,9 @@ public Observable> call(Response beginRevokeAccessDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRevokeAccessDelegate(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()) .registerError(CloudException.class) .build(response); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UpgradeOperationHistoricalStatusInfoInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UpgradeOperationHistoricalStatusInfoInner.java new file mode 100644 index 00000000000..b828db2abc1 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UpgradeOperationHistoricalStatusInfoInner.java @@ -0,0 +1,63 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.compute.UpgradeOperationHistoricalStatusInfoProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Machine Scale Set OS Upgrade History operation response. + */ +public class UpgradeOperationHistoricalStatusInfoInner { + /** + * Information about the properties of the upgrade operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private UpgradeOperationHistoricalStatusInfoProperties properties; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get information about the properties of the upgrade operation. + * + * @return the properties value + */ + public UpgradeOperationHistoricalStatusInfoProperties properties() { + return this.properties; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsageInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsageInner.java index 71d78eadc2a..4043904c439 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsageInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsageInner.java @@ -47,7 +47,7 @@ public UsageInner() { } /** - * Get the unit value. + * Get an enum describing the unit of usage measurement. * * @return the unit value */ @@ -56,7 +56,7 @@ public String unit() { } /** - * Set the unit value. + * Set an enum describing the unit of usage measurement. * * @param unit the unit value to set * @return the UsageInner object itself. @@ -67,7 +67,7 @@ public UsageInner withUnit(String unit) { } /** - * Get the currentValue value. + * Get the current usage of the resource. * * @return the currentValue value */ @@ -76,7 +76,7 @@ public int currentValue() { } /** - * Set the currentValue value. + * Set the current usage of the resource. * * @param currentValue the currentValue value to set * @return the UsageInner object itself. @@ -87,7 +87,7 @@ public UsageInner withCurrentValue(int currentValue) { } /** - * Get the limit value. + * Get the maximum permitted usage of the resource. * * @return the limit value */ @@ -96,7 +96,7 @@ public long limit() { } /** - * Set the limit value. + * Set the maximum permitted usage of the resource. * * @param limit the limit value to set * @return the UsageInner object itself. @@ -107,7 +107,7 @@ public UsageInner withLimit(long limit) { } /** - * Get the name value. + * Get the name of the type of usage. * * @return the name value */ @@ -116,7 +116,7 @@ public UsageName name() { } /** - * Set the name value. + * Set the name of the type of usage. * * @param name the name value to set * @return the UsageInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java index c3d91764761..819e8256daa 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java @@ -157,7 +157,7 @@ public Observable>> listSinglePageAsync(final S if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VMSSPatchPayload.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VMSSPatchPayload.java new file mode 100644 index 00000000000..78ddf598dee --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VMSSPatchPayload.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.microsoft.azure.management.compute.implementation; + +import com.microsoft.azure.SubResource; +import com.microsoft.azure.management.compute.VirtualMachineScaleSet; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetIPConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdate; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateIPConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateNetworkConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateNetworkProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateOSDisk; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateOSProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateStorageProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdateVMProfile; + +import java.util.ArrayList; + +class VMSSPatchPayload { + static VirtualMachineScaleSetUpdate preparePatchPayload(VirtualMachineScaleSet scaleSet) { + VirtualMachineScaleSetUpdate updateParameter = new VirtualMachineScaleSetUpdate(); + // + updateParameter.withIdentity(scaleSet.inner().identity()); + updateParameter.withOverprovision(scaleSet.inner().overprovision()); + updateParameter.withPlan(scaleSet.inner().plan()); + updateParameter.withSinglePlacementGroup(scaleSet.inner().singlePlacementGroup()); + updateParameter.withSku(scaleSet.inner().sku()); + updateParameter.withTags(scaleSet.inner().getTags()); + updateParameter.withUpgradePolicy(scaleSet.inner().upgradePolicy()); + // + if (scaleSet.inner().virtualMachineProfile() != null) { + // -- + VirtualMachineScaleSetUpdateVMProfile updateVMProfile = new VirtualMachineScaleSetUpdateVMProfile(); + updateVMProfile.withDiagnosticsProfile(scaleSet.inner().virtualMachineProfile().diagnosticsProfile()); + updateVMProfile.withExtensionProfile(scaleSet.inner().virtualMachineProfile().extensionProfile()); + updateVMProfile.withLicenseType(scaleSet.inner().virtualMachineProfile().licenseType()); + // + if (scaleSet.inner().virtualMachineProfile().storageProfile() != null) { + // -- -- + VirtualMachineScaleSetUpdateStorageProfile storageProfile = new VirtualMachineScaleSetUpdateStorageProfile(); + storageProfile.withDataDisks(scaleSet.inner().virtualMachineProfile().storageProfile().dataDisks()); + storageProfile.withImageReference(scaleSet.inner().virtualMachineProfile().storageProfile().imageReference()); + + if (scaleSet.inner().virtualMachineProfile().storageProfile().osDisk() != null) { + VirtualMachineScaleSetUpdateOSDisk osDisk = new VirtualMachineScaleSetUpdateOSDisk(); + osDisk.withCaching(scaleSet.inner().virtualMachineProfile().storageProfile().osDisk().caching()); + osDisk.withImage(scaleSet.inner().virtualMachineProfile().storageProfile().osDisk().image()); + osDisk.withManagedDisk(scaleSet.inner().virtualMachineProfile().storageProfile().osDisk().managedDisk()); + osDisk.withVhdContainers(scaleSet.inner().virtualMachineProfile().storageProfile().osDisk().vhdContainers()); + osDisk.withWriteAcceleratorEnabled(scaleSet.inner().virtualMachineProfile().storageProfile().osDisk().writeAcceleratorEnabled()); + storageProfile.withOsDisk(osDisk); + } + updateVMProfile.withStorageProfile(storageProfile); + // -- -- + } + if (scaleSet.inner().virtualMachineProfile().osProfile() != null) { + // -- -- + VirtualMachineScaleSetUpdateOSProfile osProfile = new VirtualMachineScaleSetUpdateOSProfile(); + osProfile.withCustomData(scaleSet.inner().virtualMachineProfile().osProfile().customData()); + osProfile.withLinuxConfiguration(scaleSet.inner().virtualMachineProfile().osProfile().linuxConfiguration()); + osProfile.withSecrets(scaleSet.inner().virtualMachineProfile().osProfile().secrets()); + osProfile.withWindowsConfiguration(scaleSet.inner().virtualMachineProfile().osProfile().windowsConfiguration()); + updateVMProfile.withOsProfile(osProfile); + // -- -- + } + if (scaleSet.inner().virtualMachineProfile().networkProfile() != null) { + // -- -- + VirtualMachineScaleSetUpdateNetworkProfile networkProfile = new VirtualMachineScaleSetUpdateNetworkProfile(); + + if (scaleSet.inner().virtualMachineProfile().networkProfile().networkInterfaceConfigurations() != null) { + networkProfile.withNetworkInterfaceConfigurations(new ArrayList()); + for (VirtualMachineScaleSetNetworkConfiguration nicConfig : scaleSet.inner().virtualMachineProfile().networkProfile().networkInterfaceConfigurations()) { + VirtualMachineScaleSetUpdateNetworkConfiguration nicPatchConfig = new VirtualMachineScaleSetUpdateNetworkConfiguration(); + nicPatchConfig.withDnsSettings(nicConfig.dnsSettings()); + nicPatchConfig.withEnableAcceleratedNetworking(nicConfig.enableAcceleratedNetworking()); + nicPatchConfig.withEnableIPForwarding(nicConfig.enableIPForwarding()); + nicPatchConfig.withName(nicConfig.name()); + nicPatchConfig.withNetworkSecurityGroup(nicConfig.networkSecurityGroup()); + nicPatchConfig.withPrimary(nicConfig.primary()); + nicPatchConfig.withId(nicConfig.id()); + if (nicConfig.ipConfigurations() != null) { + nicPatchConfig.withIpConfigurations(new ArrayList()); + for (VirtualMachineScaleSetIPConfiguration ipConfig : nicConfig.ipConfigurations()) { + VirtualMachineScaleSetUpdateIPConfiguration patchIpConfig = new VirtualMachineScaleSetUpdateIPConfiguration(); + patchIpConfig.withApplicationGatewayBackendAddressPools(ipConfig.applicationGatewayBackendAddressPools()); + patchIpConfig.withLoadBalancerBackendAddressPools(ipConfig.loadBalancerBackendAddressPools()); + patchIpConfig.withLoadBalancerInboundNatPools(ipConfig.loadBalancerInboundNatPools()); + patchIpConfig.withName(ipConfig.name()); + patchIpConfig.withPrimary(ipConfig.primary()); + patchIpConfig.withPrivateIPAddressVersion(ipConfig.privateIPAddressVersion()); + patchIpConfig.withSubnet(ipConfig.subnet()); + patchIpConfig.withId(ipConfig.id()); + if (ipConfig.publicIPAddressConfiguration() != null) { + patchIpConfig.withPublicIPAddressConfiguration(new VirtualMachineScaleSetUpdatePublicIPAddressConfiguration()); + patchIpConfig.publicIPAddressConfiguration().withDnsSettings(ipConfig.publicIPAddressConfiguration().dnsSettings()); + patchIpConfig.publicIPAddressConfiguration().withIdleTimeoutInMinutes(ipConfig.publicIPAddressConfiguration().idleTimeoutInMinutes()); + patchIpConfig.publicIPAddressConfiguration().withName(ipConfig.publicIPAddressConfiguration().name()); + } + if (ipConfig.applicationSecurityGroups() != null) { + patchIpConfig.withApplicationSecurityGroups(new ArrayList()); + for (SubResource asg : ipConfig.applicationSecurityGroups()) { + patchIpConfig.applicationSecurityGroups().add(new SubResource().withId(asg.id())); + } + } + nicPatchConfig.ipConfigurations().add(patchIpConfig); + } + } + networkProfile.networkInterfaceConfigurations().add(nicPatchConfig); + } + } + updateVMProfile.withNetworkProfile(networkProfile); + // -- -- + } + updateParameter.withVirtualMachineProfile(updateVMProfile); + // -- + } + // + return updateParameter; + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureResultInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureResultInner.java index fc79bfbd422..6c6dc22ec15 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureResultInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineCaptureResultInner.java @@ -8,39 +8,72 @@ package com.microsoft.azure.management.compute.implementation; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.SubResource; /** - * Resource Id. + * Output of virtual machine capture operation. */ -@JsonFlatten public class VirtualMachineCaptureResultInner extends SubResource { /** - * Operation output data (raw JSON). + * the schema of the captured virtual machine. */ - @JsonProperty(value = "properties.output") - private Object output; + @JsonProperty(value = "$schema", access = JsonProperty.Access.WRITE_ONLY) + private String schema; /** - * Get the output value. + * the version of the content. + */ + @JsonProperty(value = "contentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String contentVersion; + + /** + * parameters of the captured virtual machine. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private Object parameters; + + /** + * a list of resource items of the captured virtual machine. + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; + + /** + * Get the schema of the captured virtual machine. + * + * @return the schema value + */ + public String schema() { + return this.schema; + } + + /** + * Get the version of the content. + * + * @return the contentVersion value + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Get parameters of the captured virtual machine. * - * @return the output value + * @return the parameters value */ - public Object output() { - return this.output; + public Object parameters() { + return this.parameters; } /** - * Set the output value. + * Get a list of resource items of the captured virtual machine. * - * @param output the output value to set - * @return the VirtualMachineCaptureResultInner object itself. + * @return the resources value */ - public VirtualMachineCaptureResultInner withOutput(Object output) { - this.output = output; - return this; + public List resources() { + return this.resources; } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageInner.java index b673c7d5771..01d3ca4e013 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageInner.java @@ -52,7 +52,7 @@ public class VirtualMachineExtensionImageInner extends Resource { private Boolean supportsMultipleExtensions; /** - * Get the operatingSystem value. + * Get the operating system this extension supports. * * @return the operatingSystem value */ @@ -61,7 +61,7 @@ public String operatingSystem() { } /** - * Set the operatingSystem value. + * Set the operating system this extension supports. * * @param operatingSystem the operatingSystem value to set * @return the VirtualMachineExtensionImageInner object itself. @@ -72,7 +72,7 @@ public VirtualMachineExtensionImageInner withOperatingSystem(String operatingSys } /** - * Get the computeRole value. + * Get the type of role (IaaS or PaaS) this extension supports. * * @return the computeRole value */ @@ -81,7 +81,7 @@ public String computeRole() { } /** - * Set the computeRole value. + * Set the type of role (IaaS or PaaS) this extension supports. * * @param computeRole the computeRole value to set * @return the VirtualMachineExtensionImageInner object itself. @@ -92,7 +92,7 @@ public VirtualMachineExtensionImageInner withComputeRole(String computeRole) { } /** - * Get the handlerSchema value. + * Get the schema defined by publisher, where extension consumers should provide settings in a matching schema. * * @return the handlerSchema value */ @@ -101,7 +101,7 @@ public String handlerSchema() { } /** - * Set the handlerSchema value. + * Set the schema defined by publisher, where extension consumers should provide settings in a matching schema. * * @param handlerSchema the handlerSchema value to set * @return the VirtualMachineExtensionImageInner object itself. @@ -112,7 +112,7 @@ public VirtualMachineExtensionImageInner withHandlerSchema(String handlerSchema) } /** - * Get the vmScaleSetEnabled value. + * Get whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. * * @return the vmScaleSetEnabled value */ @@ -121,7 +121,7 @@ public Boolean vmScaleSetEnabled() { } /** - * Set the vmScaleSetEnabled value. + * Set whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. * * @param vmScaleSetEnabled the vmScaleSetEnabled value to set * @return the VirtualMachineExtensionImageInner object itself. @@ -132,7 +132,7 @@ public VirtualMachineExtensionImageInner withVmScaleSetEnabled(Boolean vmScaleSe } /** - * Get the supportsMultipleExtensions value. + * Get whether the handler can support multiple extensions. * * @return the supportsMultipleExtensions value */ @@ -141,7 +141,7 @@ public Boolean supportsMultipleExtensions() { } /** - * Set the supportsMultipleExtensions value. + * Set whether the handler can support multiple extensions. * * @param supportsMultipleExtensions the supportsMultipleExtensions value to set * @return the VirtualMachineExtensionImageInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java index 821c88e1a11..add25d0caeb 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java @@ -142,7 +142,7 @@ public Observable> getWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.get(location, publisherName, type, version, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -226,7 +226,7 @@ public Observable>> list if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listTypes(location, publisherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -317,7 +317,7 @@ public Observable>> list if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String filter = null; final Integer top = null; final String orderby = null; @@ -416,7 +416,7 @@ public Observable>> list if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listVersions(location, publisherName, type, this.client.subscriptionId(), filter, top, orderby, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionInner.java index 10a9b16caa9..f8871c56081 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionInner.java @@ -79,7 +79,7 @@ public class VirtualMachineExtensionInner extends Resource { private VirtualMachineExtensionInstanceView instanceView; /** - * Get the forceUpdateTag value. + * Get how the extension handler should be forced to update even if the extension configuration has not changed. * * @return the forceUpdateTag value */ @@ -88,7 +88,7 @@ public String forceUpdateTag() { } /** - * Set the forceUpdateTag value. + * 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 VirtualMachineExtensionInner object itself. @@ -99,7 +99,7 @@ public VirtualMachineExtensionInner withForceUpdateTag(String forceUpdateTag) { } /** - * Get the publisher value. + * Get the name of the extension handler publisher. * * @return the publisher value */ @@ -108,7 +108,7 @@ public String publisher() { } /** - * Set the publisher value. + * Set the name of the extension handler publisher. * * @param publisher the publisher value to set * @return the VirtualMachineExtensionInner object itself. @@ -119,7 +119,7 @@ public VirtualMachineExtensionInner withPublisher(String publisher) { } /** - * Get the virtualMachineExtensionType value. + * Get specifies the type of the extension; an example is "CustomScriptExtension". * * @return the virtualMachineExtensionType value */ @@ -128,7 +128,7 @@ public String virtualMachineExtensionType() { } /** - * Set the virtualMachineExtensionType value. + * Set specifies the type of the extension; an example is "CustomScriptExtension". * * @param virtualMachineExtensionType the virtualMachineExtensionType value to set * @return the VirtualMachineExtensionInner object itself. @@ -139,7 +139,7 @@ public VirtualMachineExtensionInner withVirtualMachineExtensionType(String virtu } /** - * Get the typeHandlerVersion value. + * Get specifies the version of the script handler. * * @return the typeHandlerVersion value */ @@ -148,7 +148,7 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion value. + * Set specifies the version of the script handler. * * @param typeHandlerVersion the typeHandlerVersion value to set * @return the VirtualMachineExtensionInner object itself. @@ -159,7 +159,7 @@ public VirtualMachineExtensionInner withTypeHandlerVersion(String typeHandlerVer } /** - * Get the autoUpgradeMinorVersion value. + * 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 */ @@ -168,7 +168,7 @@ public Boolean autoUpgradeMinorVersion() { } /** - * Set the autoUpgradeMinorVersion value. + * 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 VirtualMachineExtensionInner object itself. @@ -179,7 +179,7 @@ public VirtualMachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgr } /** - * Get the settings value. + * Get json formatted public settings for the extension. * * @return the settings value */ @@ -188,7 +188,7 @@ public Object settings() { } /** - * Set the settings value. + * Set json formatted public settings for the extension. * * @param settings the settings value to set * @return the VirtualMachineExtensionInner object itself. @@ -199,7 +199,7 @@ public VirtualMachineExtensionInner withSettings(Object settings) { } /** - * Get the protectedSettings value. + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. * * @return the protectedSettings value */ @@ -208,7 +208,7 @@ public Object protectedSettings() { } /** - * Set the protectedSettings value. + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. * * @param protectedSettings the protectedSettings value to set * @return the VirtualMachineExtensionInner object itself. @@ -219,7 +219,7 @@ public VirtualMachineExtensionInner withProtectedSettings(Object protectedSettin } /** - * Get the provisioningState value. + * Get the provisioning state, which only appears in the response. * * @return the provisioningState value */ @@ -228,7 +228,7 @@ public String provisioningState() { } /** - * Get the instanceView value. + * Get the virtual machine extension instance view. * * @return the instanceView value */ @@ -237,7 +237,7 @@ public VirtualMachineExtensionInstanceView instanceView() { } /** - * Set the instanceView value. + * Set the virtual machine extension instance view. * * @param instanceView the instanceView value to set * @return the VirtualMachineExtensionInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java index d305cd8be81..45692ab1f88 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java @@ -11,6 +11,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.compute.VirtualMachineExtensionUpdate; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -22,6 +23,7 @@ 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; @@ -63,6 +65,14 @@ interface VirtualMachineExtensionsService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineExtensions update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineExtensions beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineExtensions delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("vmExtensionName") String vmExtensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -75,13 +85,17 @@ interface VirtualMachineExtensionsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("vmExtensionName") String vmExtensionName, @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.VirtualMachineExtensions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions") + Observable> list(@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); + } /** * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @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 @@ -97,7 +111,7 @@ public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, Str * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @param vmExtensionName The name of the virtual machine extension. * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -112,7 +126,7 @@ public ServiceFuture createOrUpdateAsync(String re * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @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 @@ -131,7 +145,7 @@ public VirtualMachineExtensionInner call(ServiceResponse> createOrUpdateW throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); } Validator.validate(extensionParameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -163,7 +177,7 @@ public Observable> createOrUpdateW * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @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 @@ -179,7 +193,7 @@ public VirtualMachineExtensionInner beginCreateOrUpdate(String resourceGroupName * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @param vmExtensionName The name of the virtual machine extension. * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -194,7 +208,7 @@ public ServiceFuture beginCreateOrUpdateAsync(Stri * The operation to create or update the extension. * * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmName The name of the virtual machine where the extension should be created or updated. * @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 @@ -213,7 +227,7 @@ public VirtualMachineExtensionInner call(ServiceResponse> beginCreateOrUp throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); } Validator.validate(extensionParameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCreateOrUpdate(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -259,6 +273,187 @@ private ServiceResponse beginCreateOrUpdateDelegat .build(response); } + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 + * @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. + */ + public VirtualMachineExtensionInner update(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().last().body(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension 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 vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 for the request + */ + public Observable updateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + 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 (vmExtensionName == null) { + throw new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + Validator.validate(extensionParameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.update(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 + * @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. + */ + public VirtualMachineExtensionInner beginUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().single().body(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension 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 vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 + */ + public Observable beginUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @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 + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { + 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 (vmExtensionName == null) { + throw new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); + } + Validator.validate(extensionParameters); + final String apiVersion = "2018-06-01"; + return service.beginUpdate(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), extensionParameters, 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 extension. * @@ -268,10 +463,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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner delete(String resourceGroupName, String vmName, String vmExtensionName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().last().body(); + public void delete(String resourceGroupName, String vmName, String vmExtensionName) { + deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().last().body(); } /** @@ -284,7 +478,7 @@ public OperationStatusResponseInner delete(String resourceGroupName, String vmNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); } @@ -297,10 +491,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -315,7 +509,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -328,9 +522,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -342,10 +536,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String vmName, String vmExtensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single().body(); } /** @@ -358,7 +551,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); } @@ -369,12 +562,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param vmName The name of the virtual machine where the extension should be deleted. * @param vmExtensionName The name of the virtual machine extension. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -387,9 +580,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -402,13 +595,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -417,9 +610,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -495,7 +688,7 @@ public Observable> getWithServiceR if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String expand = null; return service.get(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -584,7 +777,7 @@ public Observable> getWithServiceR if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.get(resourceGroupName, vmName, vmExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -606,4 +799,170 @@ private ServiceResponse getDelegate(Response listAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineExtensionsListResultInner object + */ + public Observable listAsync(String resourceGroupName, String vmName) { + return listWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, VirtualMachineExtensionsListResultInner>() { + @Override + public VirtualMachineExtensionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineExtensionsListResultInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, 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 = "2018-06-01"; + final String expand = null; + return service.list(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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @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 VirtualMachineExtensionsListResultInner object if successful. + */ + public VirtualMachineExtensionsListResultInner list(String resourceGroupName, String vmName, String expand) { + return listWithServiceResponseAsync(resourceGroupName, vmName, expand).toBlocking().single().body(); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @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(String resourceGroupName, String vmName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, vmName, expand), serviceCallback); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @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 + */ + public Observable listAsync(String resourceGroupName, String vmName, String expand) { + return listWithServiceResponseAsync(resourceGroupName, vmName, expand).map(new Func1, VirtualMachineExtensionsListResultInner>() { + @Override + public VirtualMachineExtensionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @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 + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String vmName, 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 = "2018-06-01"; + return service.list(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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsListResultInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsListResultInner.java new file mode 100644 index 00000000000..d7552310e2d --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsListResultInner.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.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List Extension operation response. + */ +public class VirtualMachineExtensionsListResultInner { + /** + * The list of extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of extensions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of extensions. + * + * @param value the value value to set + * @return the VirtualMachineExtensionsListResultInner object itself. + */ + public VirtualMachineExtensionsListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImageResourceInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImageResourceInner.java index bf9d4d0f0e9..9c18ab1e9b0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImageResourceInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImageResourceInner.java @@ -37,7 +37,7 @@ public class VirtualMachineImageResourceInner extends SubResource { private Map tags; /** - * Get the name value. + * Get the name of the resource. * * @return the name value */ @@ -46,7 +46,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the resource. * * @param name the name value to set * @return the VirtualMachineImageResourceInner object itself. @@ -57,7 +57,7 @@ public VirtualMachineImageResourceInner withName(String name) { } /** - * Get the location value. + * Get the supported Azure location of the resource. * * @return the location value */ @@ -66,7 +66,7 @@ public String location() { } /** - * Set the location value. + * Set the supported Azure location of the resource. * * @param location the location value to set * @return the VirtualMachineImageResourceInner object itself. @@ -77,7 +77,7 @@ public VirtualMachineImageResourceInner withLocation(String location) { } /** - * Get the tags value. + * Get specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). * * @return the tags value */ @@ -86,7 +86,7 @@ public Map tags() { } /** - * Set the tags value. + * Set specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). * * @param tags the tags value to set * @return the VirtualMachineImageResourceInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java index ddda82d3f99..d6f3d44d9e2 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java @@ -157,7 +157,7 @@ public Observable> getWithServiceRespo if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.get(location, publisherName, offer, skus, version, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -255,7 +255,7 @@ public Observable>> listW if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String filter = null; final Integer top = null; final String orderby = null; @@ -361,7 +361,7 @@ public Observable>> listW if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(location, publisherName, offer, skus, this.client.subscriptionId(), filter, top, orderby, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -445,7 +445,7 @@ public Observable>> listO if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listOffers(location, publisherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -522,7 +522,7 @@ public Observable>> listP if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listPublishers(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -613,7 +613,7 @@ public Observable>> listS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listSkus(location, publisherName, offer, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java index c86af28a806..f14fb735eb0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java @@ -28,6 +28,8 @@ import com.microsoft.azure.management.compute.KnownLinuxVirtualMachineImage; import com.microsoft.azure.management.compute.KnownWindowsVirtualMachineImage; import com.microsoft.azure.management.compute.LinuxConfiguration; +import com.microsoft.azure.management.compute.ManagedDiskParameters; +import com.microsoft.azure.management.compute.NetworkInterfaceReference; import com.microsoft.azure.management.compute.OSDisk; import com.microsoft.azure.management.compute.OSProfile; import com.microsoft.azure.management.compute.OperatingSystemTypes; @@ -41,6 +43,7 @@ import com.microsoft.azure.management.compute.StorageProfile; import com.microsoft.azure.management.compute.VirtualHardDisk; import com.microsoft.azure.management.compute.VirtualMachine; +import com.microsoft.azure.management.compute.VirtualMachineCaptureParameters; import com.microsoft.azure.management.compute.VirtualMachineDataDisk; import com.microsoft.azure.management.compute.VirtualMachineEncryption; import com.microsoft.azure.management.compute.VirtualMachineUnmanagedDataDisk; @@ -48,6 +51,7 @@ import com.microsoft.azure.management.compute.VirtualMachineInstanceView; import com.microsoft.azure.management.compute.VirtualMachineSize; import com.microsoft.azure.management.compute.VirtualMachineSizeTypes; +import com.microsoft.azure.management.compute.VirtualMachineUpdate; import com.microsoft.azure.management.compute.WinRMConfiguration; import com.microsoft.azure.management.compute.WinRMListener; import com.microsoft.azure.management.compute.WindowsConfiguration; @@ -212,7 +216,7 @@ public void deallocate() { @Override public Completable deallocateAsync() { - Observable o = this.manager().inner().virtualMachines().deallocateAsync(this.resourceGroupName(), this.name()); + Observable o = this.manager().inner().virtualMachines().deallocateAsync(this.resourceGroupName(), this.name()); Observable r = this.refreshAsync(); // Refresh after deallocate to ensure the inner is updatable (due to a change in behavior in Managed Disks) @@ -308,9 +312,9 @@ public void convertToManaged() { @Override public Completable convertToManagedAsync() { return this.manager().inner().virtualMachines().convertToManagedDisksAsync(this.resourceGroupName(), this.name()) - .flatMap(new Func1>() { + .flatMap(new Func1>() { @Override - public Observable call(OperationStatusResponseInner operationStatusResponseInner) { + public Observable call(Void theVoid) { return refreshAsync(); } }).toCompletable(); @@ -346,7 +350,7 @@ public String capture(String containerName, String vhdPrefix, boolean overwriteV @Override public Observable captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd) { - VirtualMachineCaptureParametersInner parameters = new VirtualMachineCaptureParametersInner(); + VirtualMachineCaptureParameters parameters = new VirtualMachineCaptureParameters(); parameters.withDestinationContainerName(containerName); parameters.withOverwriteVhds(overwriteVhd); parameters.withVhdPrefix(vhdPrefix); @@ -362,7 +366,7 @@ public String call(VirtualMachineCaptureResultInner innerResult) { ObjectMapper mapper = new ObjectMapper(); //Object to JSON string try { - return mapper.writeValueAsString(innerResult.output()); + return mapper.writeValueAsString(innerResult); } catch (JsonProcessingException e) { throw Exceptions.propagate(e); } @@ -555,7 +559,7 @@ public VirtualMachineImpl withPopularLinuxImage(KnownLinuxVirtualMachineImage kn @Override public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.inner().storageProfile().withImageReference(imageReference.inner()); + this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image" or "VM(Platform)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); @@ -566,7 +570,7 @@ public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageRe @Override public VirtualMachineImpl withSpecificLinuxImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); - this.inner().storageProfile().withImageReference(imageReference.inner()); + this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration()); this.isMarketplaceLinuxImage = true; return this; @@ -594,7 +598,7 @@ public VirtualMachineImpl withLatestLinuxImage(String publisher, String offer, S @Override public VirtualMachineImpl withWindowsCustomImage(String customImageId) { - ImageReferenceInner imageReferenceInner = new ImageReferenceInner(); + ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); @@ -607,7 +611,7 @@ public VirtualMachineImpl withWindowsCustomImage(String customImageId) { @Override public VirtualMachineImpl withLinuxCustomImage(String customImageId) { - ImageReferenceInner imageReferenceInner = new ImageReferenceInner(); + ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); @@ -629,7 +633,7 @@ public VirtualMachineImpl withSpecializedOSUnmanagedDisk(String osDiskUrl, Opera @Override public VirtualMachineImpl withSpecializedOSDisk(Disk disk, OperatingSystemTypes osType) { - ManagedDiskParametersInner diskParametersInner = new ManagedDiskParametersInner(); + ManagedDiskParameters diskParametersInner = new ManagedDiskParameters(); diskParametersInner.withId(disk.id()); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.ATTACH); this.inner().storageProfile().osDisk().withManagedDisk(diskParametersInner); @@ -799,7 +803,7 @@ public VirtualMachineImpl withOSDiskStorageAccountType(StorageAccountTypes accou this.inner() .storageProfile() .osDisk() - .withManagedDisk(new ManagedDiskParametersInner()); + .withManagedDisk(new ManagedDiskParameters()); } this.inner() .storageProfile() @@ -960,7 +964,7 @@ public VirtualMachineImpl withNewDataDisk(int sizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType) { throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner(); + ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); managedDiskParameters.withStorageAccountType(storageAccountType); this.managedDataDisks.implicitDisksToAssociate.add(new DataDisk() .withLun(lun) @@ -973,7 +977,7 @@ public VirtualMachineImpl withNewDataDisk(int sizeInGB, @Override public VirtualMachineImpl withExistingDataDisk(Disk disk) { throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner(); + ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); managedDiskParameters.withId(disk.id()); this.managedDataDisks.existingDisksToAttach.add(new DataDisk() .withLun(-1) @@ -984,7 +988,7 @@ public VirtualMachineImpl withExistingDataDisk(Disk disk) { @Override public VirtualMachineImpl withExistingDataDisk(Disk disk, int lun, CachingTypes cachingType) { throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner(); + ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); managedDiskParameters.withId(disk.id()); this.managedDataDisks.existingDisksToAttach.add(new DataDisk() .withLun(lun) @@ -996,7 +1000,7 @@ public VirtualMachineImpl withExistingDataDisk(Disk disk, int lun, CachingTypes @Override public VirtualMachineImpl withExistingDataDisk(Disk disk, int newSizeInGB, int lun, CachingTypes cachingType) { throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VM_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED); - ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner(); + ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); managedDiskParameters.withId(disk.id()); this.managedDataDisks.existingDisksToAttach.add(new DataDisk() .withLun(lun) @@ -1025,7 +1029,7 @@ public VirtualMachineImpl withNewDataDiskFromImage(int imageLun, int newSizeInGB @Override public VirtualMachineImpl withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType) { - ManagedDiskParametersInner managedDiskParameters = new ManagedDiskParametersInner(); + ManagedDiskParameters managedDiskParameters = new ManagedDiskParameters(); managedDiskParameters.withStorageAccountType(storageAccountType); this.managedDataDisks.newDisksFromImage.add(new DataDisk() .withLun(imageLun) @@ -1196,7 +1200,7 @@ public VirtualMachineImpl withoutSecondaryNetworkInterface(String name) { if (this.inner().networkProfile() != null && this.inner().networkProfile().networkInterfaces() != null) { int idx = -1; - for (NetworkInterfaceReferenceInner nicReference : this.inner().networkProfile().networkInterfaces()) { + for (NetworkInterfaceReference nicReference : this.inner().networkProfile().networkInterfaces()) { idx++; if (!nicReference.primary() && name.equalsIgnoreCase(ResourceUtils.nameFromResourceId(nicReference.id()))) { @@ -1275,17 +1279,16 @@ public VirtualMachineImpl withoutBootDiagnostics() { @Override public VirtualMachineImpl withSystemAssignedManagedServiceIdentity() { - this.virtualMachineMsiHandler.withLocalManagedServiceIdentity(); + this.virtualMachineMsiHandler.withLocalManagedServiceIdentity(); return this; } @Override - public VirtualMachineImpl withSystemAssignedManagedServiceIdentity(int tokenPort) { - this.virtualMachineMsiHandler.withLocalManagedServiceIdentity(tokenPort); + public VirtualMachineImpl withoutSystemAssignedManagedServiceIdentity() { + this.virtualMachineMsiHandler.withoutLocalManagedServiceIdentity(); return this; } - @Override public VirtualMachineImpl withSystemAssignedIdentityBasedAccessTo(String resourceId, BuiltInRole role) { this.virtualMachineMsiHandler.withAccessTo(resourceId, role); @@ -1463,7 +1466,7 @@ public String getPrimaryPublicIPAddressId() { @Override public List networkInterfaceIds() { List nicIds = new ArrayList<>(); - for (NetworkInterfaceReferenceInner nicRef : inner().networkProfile().networkInterfaces()) { + for (NetworkInterfaceReference nicRef : inner().networkProfile().networkInterfaces()) { nicIds.add(nicRef.id()); } return nicIds; @@ -1471,7 +1474,7 @@ public List networkInterfaceIds() { @Override public String primaryNetworkInterfaceId() { - final List nicRefs = this.inner().networkProfile().networkInterfaces(); + final List nicRefs = this.inner().networkProfile().networkInterfaces(); String primaryNicRefId = null; if (nicRefs.size() == 1) { @@ -1482,7 +1485,7 @@ public String primaryNetworkInterfaceId() { primaryNicRefId = null; } else { // Find primary interface as flagged by Azure - for (NetworkInterfaceReferenceInner nicRef : inner().networkProfile().networkInterfaces()) { + for (NetworkInterfaceReference nicRef : inner().networkProfile().networkInterfaces()) { if (nicRef.primary() != null && nicRef.primary()) { primaryNicRefId = nicRef.id(); break; @@ -1618,9 +1621,8 @@ public ResourceIdentityType managedServiceIdentityType() { @Override public Set userAssignedManagedServiceIdentityIds() { - if (this.inner().identity() != null && this.inner().identity().identityIds() != null) { - return Collections.unmodifiableSet(new HashSet(this.inner().identity().identityIds())); - + if (this.inner().identity() != null && this.inner().identity().userAssignedIdentities() != null) { + return Collections.unmodifiableSet(new HashSet(this.inner().identity().userAssignedIdentities().keySet())); } return Collections.unmodifiableSet(new HashSet()); } @@ -1658,11 +1660,12 @@ public void beforeGroupCreateOrUpdate() { // @Override public Observable createResourceAsync() { - if (isInCreateMode()) { - setOSDiskDefaults(); - setOSProfileDefaults(); - setHardwareProfileDefaults(); - } + // + // -- set creation-time only properties + setOSDiskDefaults(); + setOSProfileDefaults(); + setHardwareProfileDefaults(); + // if (isManagedDiskEnabled()) { managedDataDisks.setDataDisksDefaults(); } else { @@ -1672,8 +1675,8 @@ public Observable createResourceAsync() { this.bootDiagnosticsHandler.handleDiagnosticsSettings(); this.handleNetworkSettings(); this.handleAvailabilitySettings(); - this.virtualMachineMsiHandler.handleExternalIdentitySettings(); - + this.virtualMachineMsiHandler.processCreatedExternalIdentities(); + this.virtualMachineMsiHandler.handleExternalIdentities(); final VirtualMachineImpl self = this; return this.manager().inner().virtualMachines() .createOrUpdateAsync(resourceGroupName(), vmName, inner()) @@ -1687,12 +1690,51 @@ public VirtualMachine call(VirtualMachineInner virtualMachineInner) { }); } + @Override + public Observable updateResourceAsync() { + if (isManagedDiskEnabled()) { + managedDataDisks.setDataDisksDefaults(); + } else { + UnmanagedDataDiskImpl.setDataDisksDefaults(this.unmanagedDataDisks, this.vmName); + } + this.handleUnManagedOSAndDataDisksStorageSettings(); + this.bootDiagnosticsHandler.handleDiagnosticsSettings(); + this.handleNetworkSettings(); + this.handleAvailabilitySettings(); + this.virtualMachineMsiHandler.processCreatedExternalIdentities(); + // + VirtualMachineUpdate updateParameter = new VirtualMachineUpdate(); + // + updateParameter.withPlan(this.inner().plan()); + updateParameter.withHardwareProfile(this.inner().hardwareProfile()); + updateParameter.withStorageProfile(this.inner().storageProfile()); + updateParameter.withOsProfile(this.inner().osProfile()); + updateParameter.withNetworkProfile(this.inner().networkProfile()); + updateParameter.withDiagnosticsProfile(this.inner().diagnosticsProfile()); + updateParameter.withAvailabilitySet(this.inner().availabilitySet()); + updateParameter.withLicenseType(this.inner().licenseType()); + updateParameter.withZones(this.inner().zones()); + // + this.virtualMachineMsiHandler.handleExternalIdentities(updateParameter); + // + final VirtualMachineImpl self = this; + return this.manager().inner().virtualMachines() + .updateAsync(resourceGroupName(), vmName, updateParameter) + .map(new Func1() { + @Override + public VirtualMachine call(VirtualMachineInner virtualMachineInner) { + reset(virtualMachineInner); + return self; + } + + }); + } + // CreateUpdateTaskGroup.ResourceCreator.afterPostRunAsync implementation // @Override public Completable afterPostRunAsync(boolean isGroupFaulted) { this.virtualMachineExtensions.clear(); - this.virtualMachineMsiHandler.clear(); if (isGroupFaulted) { return Completable.complete(); } else { @@ -1710,6 +1752,7 @@ private void reset(VirtualMachineInner inner) { this.setInner(inner); clearCachedRelatedResources(); initializeDataDisks(); + virtualMachineMsiHandler.clear(); } VirtualMachineImpl withUnmanagedDataDisk(UnmanagedDataDiskImpl dataDisk) { @@ -1781,7 +1824,7 @@ private void setOSDiskDefaults() { // UnSupported: StoredImage // if (osDisk.managedDisk() == null) { - osDisk.withManagedDisk(new ManagedDiskParametersInner()); + osDisk.withManagedDisk(new ManagedDiskParameters()); } if (osDisk.managedDisk().storageAccountType() == null) { osDisk.managedDisk() @@ -1930,7 +1973,7 @@ private void handleNetworkSettings() { } if (primaryNetworkInterface != null) { - NetworkInterfaceReferenceInner nicReference = new NetworkInterfaceReferenceInner(); + NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); nicReference.withPrimary(true); nicReference.withId(primaryNetworkInterface.id()); this.inner().networkProfile().networkInterfaces().add(nicReference); @@ -1941,14 +1984,14 @@ private void handleNetworkSettings() { // for (String creatableSecondaryNetworkInterfaceKey : this.creatableSecondaryNetworkInterfaceKeys) { NetworkInterface secondaryNetworkInterface = this.taskResult(creatableSecondaryNetworkInterfaceKey); - NetworkInterfaceReferenceInner nicReference = new NetworkInterfaceReferenceInner(); + NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); nicReference.withPrimary(false); nicReference.withId(secondaryNetworkInterface.id()); this.inner().networkProfile().networkInterfaces().add(nicReference); } for (NetworkInterface secondaryNetworkInterface : this.existingSecondaryNetworkInterfacesToAssociate) { - NetworkInterfaceReferenceInner nicReference = new NetworkInterfaceReferenceInner(); + NetworkInterfaceReference nicReference = new NetworkInterfaceReference(); nicReference.withPrimary(false); nicReference.withId(secondaryNetworkInterface.id()); this.inner().networkProfile().networkInterfaces().add(nicReference); @@ -2064,7 +2107,7 @@ private boolean isOSDiskFromImage(OSDisk osDisk) { * @return true if the OS disk is configured to be based on platform image. */ private boolean isOSDiskFromPlatformImage(StorageProfile storageProfile) { - ImageReferenceInner imageReference = storageProfile.imageReference(); + ImageReference imageReference = storageProfile.imageReference(); return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.publisher() != null @@ -2082,7 +2125,7 @@ private boolean isOSDiskFromPlatformImage(StorageProfile storageProfile) { * @return true if the OS disk is configured to be based on custom image. */ private boolean isOsDiskFromCustomImage(StorageProfile storageProfile) { - ImageReferenceInner imageReference = storageProfile.imageReference(); + ImageReference imageReference = storageProfile.imageReference(); return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.id() != null; @@ -2313,7 +2356,7 @@ private void setAttachableNewDataDisks(Func0 nextLun) { if (dataDisk.lun() == -1) { dataDisk.withLun(nextLun.call()); } - dataDisk.withManagedDisk(new ManagedDiskParametersInner()); + dataDisk.withManagedDisk(new ManagedDiskParameters()); dataDisk.managedDisk().withId(managedDisk.id()); if (dataDisk.caching() == null) { dataDisk.withCaching(getDefaultCachingType()); @@ -2353,7 +2396,7 @@ private void setImplicitDataDisks(Func0 nextLun) { dataDisk.withCaching(getDefaultCachingType()); } if (dataDisk.managedDisk() == null) { - dataDisk.withManagedDisk(new ManagedDiskParametersInner()); + dataDisk.withManagedDisk(new ManagedDiskParameters()); } if (dataDisk.managedDisk().storageAccountType() == null) { dataDisk.managedDisk().withStorageAccountType(getDefaultStorageAccountType()); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInner.java index 23869e06831..e935b6d17c1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInner.java @@ -141,7 +141,7 @@ public class VirtualMachineInner extends Resource { private List zones; /** - * Get the plan value. + * Get specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @return the plan value */ @@ -150,7 +150,7 @@ public Plan plan() { } /** - * Set the plan value. + * Set specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @param plan the plan value to set * @return the VirtualMachineInner object itself. @@ -161,7 +161,7 @@ public VirtualMachineInner withPlan(Plan plan) { } /** - * Get the hardwareProfile value. + * Get specifies the hardware settings for the virtual machine. * * @return the hardwareProfile value */ @@ -170,7 +170,7 @@ public HardwareProfile hardwareProfile() { } /** - * Set the hardwareProfile value. + * Set specifies the hardware settings for the virtual machine. * * @param hardwareProfile the hardwareProfile value to set * @return the VirtualMachineInner object itself. @@ -181,7 +181,7 @@ public VirtualMachineInner withHardwareProfile(HardwareProfile hardwareProfile) } /** - * Get the storageProfile value. + * Get specifies the storage settings for the virtual machine disks. * * @return the storageProfile value */ @@ -190,7 +190,7 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile value. + * Set specifies the storage settings for the virtual machine disks. * * @param storageProfile the storageProfile value to set * @return the VirtualMachineInner object itself. @@ -201,7 +201,7 @@ public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { } /** - * Get the osProfile value. + * Get specifies the operating system settings for the virtual machine. * * @return the osProfile value */ @@ -210,7 +210,7 @@ public OSProfile osProfile() { } /** - * Set the osProfile value. + * Set specifies the operating system settings for the virtual machine. * * @param osProfile the osProfile value to set * @return the VirtualMachineInner object itself. @@ -221,7 +221,7 @@ public VirtualMachineInner withOsProfile(OSProfile osProfile) { } /** - * Get the networkProfile value. + * Get specifies the network interfaces of the virtual machine. * * @return the networkProfile value */ @@ -230,7 +230,7 @@ public NetworkProfile networkProfile() { } /** - * Set the networkProfile value. + * Set specifies the network interfaces of the virtual machine. * * @param networkProfile the networkProfile value to set * @return the VirtualMachineInner object itself. @@ -241,7 +241,7 @@ public VirtualMachineInner withNetworkProfile(NetworkProfile networkProfile) { } /** - * Get the diagnosticsProfile value. + * Get specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @return the diagnosticsProfile value */ @@ -250,7 +250,7 @@ public DiagnosticsProfile diagnosticsProfile() { } /** - * Set the diagnosticsProfile value. + * Set specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @param diagnosticsProfile the diagnosticsProfile value to set * @return the VirtualMachineInner object itself. @@ -261,7 +261,7 @@ public VirtualMachineInner withDiagnosticsProfile(DiagnosticsProfile diagnostics } /** - * Get the availabilitySet value. + * Get specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. * * @return the availabilitySet value */ @@ -270,7 +270,7 @@ public SubResource availabilitySet() { } /** - * Set the availabilitySet value. + * Set specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. * * @param availabilitySet the availabilitySet value to set * @return the VirtualMachineInner object itself. @@ -281,7 +281,7 @@ public VirtualMachineInner withAvailabilitySet(SubResource availabilitySet) { } /** - * Get the provisioningState value. + * Get the provisioning state, which only appears in the response. * * @return the provisioningState value */ @@ -290,7 +290,7 @@ public String provisioningState() { } /** - * Get the instanceView value. + * Get the virtual machine instance view. * * @return the instanceView value */ @@ -299,7 +299,7 @@ public VirtualMachineInstanceView instanceView() { } /** - * Get the licenseType value. + * 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. * * @return the licenseType value */ @@ -308,7 +308,7 @@ public String licenseType() { } /** - * Set the licenseType value. + * 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. * * @param licenseType the licenseType value to set * @return the VirtualMachineInner object itself. @@ -319,7 +319,7 @@ public VirtualMachineInner withLicenseType(String licenseType) { } /** - * Get the vmId value. + * Get specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. * * @return the vmId value */ @@ -328,7 +328,7 @@ public String vmId() { } /** - * Get the resources value. + * Get the virtual machine child extension resources. * * @return the resources value */ @@ -337,7 +337,7 @@ public List resources() { } /** - * Get the identity value. + * Get the identity of the virtual machine, if configured. * * @return the identity value */ @@ -346,7 +346,7 @@ public VirtualMachineIdentity identity() { } /** - * Set the identity value. + * Set the identity of the virtual machine, if configured. * * @param identity the identity value to set * @return the VirtualMachineInner object itself. @@ -357,7 +357,7 @@ public VirtualMachineInner withIdentity(VirtualMachineIdentity identity) { } /** - * Get the zones value. + * Get the virtual machine zones. * * @return the zones value */ @@ -366,7 +366,7 @@ public List zones() { } /** - * Set the zones value. + * Set the virtual machine zones. * * @param zones the zones value to set * @return the VirtualMachineInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineMsiHandler.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineMsiHandler.java index 62a5b8c649b..7c31a0c5e5e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineMsiHandler.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineMsiHandler.java @@ -7,28 +7,23 @@ package com.microsoft.azure.management.compute.implementation; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.ResourceIdentityType; -import com.microsoft.azure.management.compute.VirtualMachineExtension; import com.microsoft.azure.management.compute.VirtualMachineIdentity; +import com.microsoft.azure.management.compute.VirtualMachineIdentityUserAssignedIdentitiesValue; +import com.microsoft.azure.management.compute.VirtualMachineUpdate; import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; import com.microsoft.azure.management.graphrbac.implementation.RoleAssignmentHelper; import com.microsoft.azure.management.msi.Identity; -import com.microsoft.azure.management.resources.fluentcore.dag.IndexableTaskItem; import com.microsoft.azure.management.resources.fluentcore.dag.TaskGroup; -import com.microsoft.azure.management.resources.fluentcore.dag.VoidIndexable; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; -import com.microsoft.azure.management.resources.fluentcore.model.Indexable; -import com.microsoft.azure.management.resources.fluentcore.utils.Utils; -import rx.Observable; -import rx.functions.Func0; -import rx.functions.Func1; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; /** * Utility class to set Managed Service Identity (MSI) property on a virtual machine, @@ -39,8 +34,8 @@ class VirtualMachineMsiHandler extends RoleAssignmentHelper { private final VirtualMachineImpl virtualMachine; - private MSIExtensionInstaller msiExtensionInstaller; private List creatableIdentityKeys; + private Map userAssignedIdentities; /** * Creates VirtualMachineMsiHandler. @@ -53,8 +48,8 @@ class VirtualMachineMsiHandler extends RoleAssignmentHelper { VirtualMachineImpl virtualMachine) { super(rbacManager, virtualMachine.taskGroup(), virtualMachine.idProvider()); this.virtualMachine = virtualMachine; - this.msiExtensionInstaller = null; this.creatableIdentityKeys = new ArrayList<>(); + this.userAssignedIdentities = new HashMap<>(); } /** @@ -65,19 +60,26 @@ class VirtualMachineMsiHandler extends RoleAssignmentHelper { * @return VirtualMachineMsiHandler */ VirtualMachineMsiHandler withLocalManagedServiceIdentity() { - return withLocalManagedServiceIdentity(null); + this.initVMIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); + return this; } /** - * Specifies that Local Managed Service Identity property needs to be enabled in the virtual machine. + * Specifies that Local Managed Service Identity needs to be disabled in the virtual machine. * - * @param port the port in the virtual machine to get the access token from - * @return VirtualMachineMsiHandler */ - VirtualMachineMsiHandler withLocalManagedServiceIdentity(Integer port) { - this.initVMIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); - this.scheduleMSIExtensionInstallation(port); + VirtualMachineMsiHandler withoutLocalManagedServiceIdentity() { + if (this.virtualMachine.inner().identity() == null + || this.virtualMachine.inner().identity().type() == null + || this.virtualMachine.inner().identity().type().equals(ResourceIdentityType.NONE) + || this.virtualMachine.inner().identity().type().equals(ResourceIdentityType.USER_ASSIGNED)) { + return this; + } else if (this.virtualMachine.inner().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { + this.virtualMachine.inner().identity().withType(ResourceIdentityType.NONE); + } else if (this.virtualMachine.inner().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { + this.virtualMachine.inner().identity().withType(ResourceIdentityType.USER_ASSIGNED); + } return this; } @@ -97,7 +99,6 @@ VirtualMachineMsiHandler withNewExternalManagedServiceIdentity(Creatable(); + } + + /** + * Method that handle the case where user request indicates all it want to do is remove all identities associated + * with the virtual machine. + * + * @param vmUpdate the vm update payload model + * @return true if user indented to remove all the identities. + */ + private boolean handleRemoveAllExternalIdentitiesCase(VirtualMachineUpdate vmUpdate) { + if (!this.userAssignedIdentities.isEmpty()) { + int rmCount = 0; + for (VirtualMachineIdentityUserAssignedIdentitiesValue v : this.userAssignedIdentities.values()) { + if (v == null) { + rmCount++; + } else { + break; + } + } + boolean containsRemoveOnly = rmCount > 0 && rmCount == this.userAssignedIdentities.size(); + // Check if user request contains only request for removal of identities. + if (containsRemoveOnly) { + Set currentIds = new HashSet<>(); + VirtualMachineIdentity currentIdentity = this.virtualMachine.inner().identity(); + if (currentIdentity != null && currentIdentity.userAssignedIdentities() != null) { + for (String id : currentIdentity.userAssignedIdentities().keySet()) { + currentIds.add(id.toLowerCase()); + } + } + Set removeIds = new HashSet<>(); + for (Map.Entry entrySet : this.userAssignedIdentities.entrySet()) { + if (entrySet.getValue() == null) { + removeIds.add(entrySet.getKey().toLowerCase()); + } + } + // If so check user want to remove all the identities + boolean removeAllCurrentIds = currentIds.size() == removeIds.size() && currentIds.containsAll(removeIds); + if (removeAllCurrentIds) { + // If so adjust the identity type [Setting type to SYSTEM_ASSIGNED orNONE will remove all the identities] + if (currentIdentity == null || currentIdentity.type() == null) { + vmUpdate.withIdentity(new VirtualMachineIdentity().withType(ResourceIdentityType.NONE)); + } else if (currentIdentity.type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { + vmUpdate.withIdentity(currentIdentity); + vmUpdate.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); + } else if (currentIdentity.type().equals(ResourceIdentityType.USER_ASSIGNED)) { + vmUpdate.withIdentity(currentIdentity); + vmUpdate.identity().withType(ResourceIdentityType.NONE); + } + // and set identities property in the payload model to null so that it won't be sent + vmUpdate.identity().withUserAssignedIdentities(null); + return true; + } else { + // Check user is asking to remove identities though there is no identities currently associated + if (currentIds.size() == 0 + && removeIds.size() != 0 + && currentIdentity == null) { + // If so we are in a invalid state but we want to send user input to service and let service + // handle it (ignore or error). + vmUpdate.withIdentity(new VirtualMachineIdentity().withType(ResourceIdentityType.NONE)); + vmUpdate.identity().withUserAssignedIdentities(null); + return true; + } + } + } } + return false; } /** @@ -174,194 +270,5 @@ private void initVMIdentity(ResourceIdentityType identityType) { } else { virtualMachineInner.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED); } - if (virtualMachineInner.identity().identityIds() == null) { - if (identityType.equals(ResourceIdentityType.USER_ASSIGNED) - || identityType.equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - virtualMachineInner.identity().withIdentityIds(new ArrayList()); - } - } - } - - /** - * Schedule a task to install MSI extension after VM createOrUpdate. - * - * @param port the port that future application running on the virtual machine uses - * to get the token - */ - private void scheduleMSIExtensionInstallation(Integer port) { - if (this.msiExtensionInstaller == null) { - this.msiExtensionInstaller = new MSIExtensionInstaller(this.virtualMachine); - this.msiExtensionInstaller.withTokenPort(port); - this.virtualMachine.taskGroup().addPostRunDependent(this.msiExtensionInstaller); - } - } - - /** - * The TaskItem in the graph that configure MSI extension in a virtual machine. - */ - private static class MSIExtensionInstaller extends IndexableTaskItem { - private static final int DEFAULT_TOKEN_PORT = 50342; - private static final String MSI_EXTENSION_PUBLISHER_NAME = "Microsoft.ManagedIdentity"; - private static final String LINUX_MSI_EXTENSION = "ManagedIdentityExtensionForLinux"; - private static final String WINDOWS_MSI_EXTENSION = "ManagedIdentityExtensionForWindows"; - private final String msiExtensionTypeName; - - private Integer tokenPort; - private final VirtualMachineImpl virtualMachine; - - /** - * Creates MSIExtensionInstaller. - * - * @param virtualMachine the virtual machine for which MSI extension need to be configured - */ - MSIExtensionInstaller(final VirtualMachineImpl virtualMachine) { - this.tokenPort = null; - this.virtualMachine = virtualMachine; - OperatingSystemTypes osType = virtualMachine.osType(); - if (osType == null) { - throw new IllegalStateException("MSIExtensionInstaller: Unable to resolve the operating system type"); - } - this.msiExtensionTypeName = osType == OperatingSystemTypes.LINUX ? LINUX_MSI_EXTENSION : WINDOWS_MSI_EXTENSION; - } - - MSIExtensionInstaller withTokenPort(Integer tokenPort) { - this.tokenPort = tokenPort; - return this; - } - - @Override - public Observable invokeTaskAsync(TaskGroup.InvocationContext context) { - return Observable.defer(new Func0>() { - @Override - public Observable call() { - return getMSIExtensionAsync(); - } - }).flatMap(new Func1>() { - @Override - public Observable call(Indexable extension) { - return updateMSIExtensionAsync((VirtualMachineExtension) extension); - } - }) - .switchIfEmpty(Observable.defer(new Func0>() { - @Override - public Observable call() { - return installMSIExtensionAsync(); - } - })); - } - - private Observable getMSIExtensionAsync() { - return virtualMachine.manager().inner().virtualMachineExtensions().getAsync(virtualMachine.resourceGroupName(), - virtualMachine.name(), - this.msiExtensionTypeName) - .map(new Func1() { - @Override - public Indexable call(VirtualMachineExtensionInner inner) { - if (inner == null) { - return voidIndexable(); - } else { - return new VirtualMachineExtensionImpl(msiExtensionTypeName, - virtualMachine, - inner, - virtualMachine.manager().inner().virtualMachineExtensions()); - } - } - }) - .filter(new Func1() { - @Override - public Boolean call(Indexable e) { - if (e instanceof VoidIndexable) { - return false; - } - VirtualMachineExtension extension = (VirtualMachineExtension) e; - return extension.publisherName().equalsIgnoreCase(MSI_EXTENSION_PUBLISHER_NAME) - && extension.typeName().equalsIgnoreCase(msiExtensionTypeName); - } - }); - } - - private Observable updateMSIExtensionAsync(VirtualMachineExtension extension) { - Integer currentTokenPort = objectToInteger(extension.publicSettings().get("port")); - Integer tokenPortToUse; - if (tokenPort != null) { - // User specified a port - tokenPortToUse = tokenPort; - } else if (currentTokenPort == null) { - // User didn't specify a port and port is not already set - tokenPortToUse = DEFAULT_TOKEN_PORT; - } else { - // User didn't specify a port and port is already set in the extension - // No need to do a PUT on extension - // - return voidObservable(); - } - Map settings = new HashMap<>(); - settings.put("port", tokenPortToUse); - extension.inner().withSettings(settings); - - return virtualMachine.manager().inner().virtualMachineExtensions() - .createOrUpdateAsync(virtualMachine.resourceGroupName(), - virtualMachine.name(), - msiExtensionTypeName, - extension.inner()) - .map(new Func1() { - @Override - public Indexable call(VirtualMachineExtensionInner inner) { - return new VirtualMachineExtensionImpl(msiExtensionTypeName, - virtualMachine, - inner, - virtualMachine.manager().inner().virtualMachineExtensions()); - } - }); - } - - private Observable installMSIExtensionAsync() { - Integer tokenPortToUse = tokenPort != null ? tokenPort : DEFAULT_TOKEN_PORT; - VirtualMachineExtensionInner extensionParameter = new VirtualMachineExtensionInner(); - extensionParameter - .withPublisher(MSI_EXTENSION_PUBLISHER_NAME) - .withVirtualMachineExtensionType(this.msiExtensionTypeName) - .withTypeHandlerVersion("1.0") - .withAutoUpgradeMinorVersion(true) - .withLocation(virtualMachine.regionName()); - Map settings = new HashMap<>(); - settings.put("port", tokenPortToUse); - extensionParameter.withSettings(settings); - extensionParameter.withProtectedSettings(null); - - return virtualMachine.manager().inner().virtualMachineExtensions() - .createOrUpdateAsync(virtualMachine.resourceGroupName(), - virtualMachine.name(), - this.msiExtensionTypeName, - extensionParameter) - .map(new Func1() { - @Override - public Indexable call(VirtualMachineExtensionInner inner) { - return new VirtualMachineExtensionImpl(msiExtensionTypeName, - virtualMachine, - inner, - virtualMachine.manager().inner().virtualMachineExtensions()); - } - }); - } - - /** - * Given an object holding a numeric in Integer or String format, convert that to - * Integer. - * - * @param obj the object - * @return the integer value - */ - private Integer objectToInteger(Object obj) { - Integer result = null; - if (obj != null) { - if (obj instanceof Integer) { - result = (Integer) obj; - } else { - result = Integer.valueOf((String) obj); - } - } - return result; - } } } \ No newline at end of file diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineRunCommandsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineRunCommandsInner.java index c894387fd06..c4f988300f5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineRunCommandsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineRunCommandsInner.java @@ -162,7 +162,7 @@ public Observable>> listSingle if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-04-01"; return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -246,7 +246,7 @@ public Observable> getWithServiceRespon if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-04-01"; return service.get(location, commandId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionInner.java index b5f5e0e6c35..462d8d445d7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionInner.java @@ -79,7 +79,7 @@ public class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { private String provisioningState; /** - * Get the name value. + * Get the name of the extension. * * @return the name value */ @@ -88,7 +88,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the extension. * * @param name the name value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -99,7 +99,7 @@ public VirtualMachineScaleSetExtensionInner withName(String name) { } /** - * Get the forceUpdateTag value. + * Get if a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. * * @return the forceUpdateTag value */ @@ -108,7 +108,7 @@ public String forceUpdateTag() { } /** - * Set the forceUpdateTag value. + * Set if a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. * * @param forceUpdateTag the forceUpdateTag value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -119,7 +119,7 @@ public VirtualMachineScaleSetExtensionInner withForceUpdateTag(String forceUpdat } /** - * Get the publisher value. + * Get the name of the extension handler publisher. * * @return the publisher value */ @@ -128,7 +128,7 @@ public String publisher() { } /** - * Set the publisher value. + * Set the name of the extension handler publisher. * * @param publisher the publisher value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -139,7 +139,7 @@ public VirtualMachineScaleSetExtensionInner withPublisher(String publisher) { } /** - * Get the type value. + * Get specifies the type of the extension; an example is "CustomScriptExtension". * * @return the type value */ @@ -148,7 +148,7 @@ public String type() { } /** - * Set the type value. + * Set specifies the type of the extension; an example is "CustomScriptExtension". * * @param type the type value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -159,7 +159,7 @@ public VirtualMachineScaleSetExtensionInner withType(String type) { } /** - * Get the typeHandlerVersion value. + * Get specifies the version of the script handler. * * @return the typeHandlerVersion value */ @@ -168,7 +168,7 @@ public String typeHandlerVersion() { } /** - * Set the typeHandlerVersion value. + * Set specifies the version of the script handler. * * @param typeHandlerVersion the typeHandlerVersion value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -179,7 +179,7 @@ public VirtualMachineScaleSetExtensionInner withTypeHandlerVersion(String typeHa } /** - * Get the autoUpgradeMinorVersion value. + * 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 */ @@ -188,7 +188,7 @@ public Boolean autoUpgradeMinorVersion() { } /** - * Set the autoUpgradeMinorVersion value. + * 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 VirtualMachineScaleSetExtensionInner object itself. @@ -199,7 +199,7 @@ public VirtualMachineScaleSetExtensionInner withAutoUpgradeMinorVersion(Boolean } /** - * Get the settings value. + * Get json formatted public settings for the extension. * * @return the settings value */ @@ -208,7 +208,7 @@ public Object settings() { } /** - * Set the settings value. + * Set json formatted public settings for the extension. * * @param settings the settings value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -219,7 +219,7 @@ public VirtualMachineScaleSetExtensionInner withSettings(Object settings) { } /** - * Get the protectedSettings value. + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. * * @return the protectedSettings value */ @@ -228,7 +228,7 @@ public Object protectedSettings() { } /** - * Set the protectedSettings value. + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. * * @param protectedSettings the protectedSettings value to set * @return the VirtualMachineScaleSetExtensionInner object itself. @@ -239,7 +239,7 @@ public VirtualMachineScaleSetExtensionInner withProtectedSettings(Object protect } /** - * Get the provisioningState value. + * Get the provisioning state, which only appears in the response. * * @return the provisioningState value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionsInner.java index c6227de9e0d..34f170f9144 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetExtensionsInner.java @@ -168,7 +168,7 @@ public Observable> createO throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); } Validator.validate(extensionParameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -250,7 +250,7 @@ public Observable> beginCr throw new IllegalArgumentException("Parameter extensionParameters is required and cannot be null."); } Validator.validate(extensionParameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), extensionParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -282,10 +282,9 @@ private ServiceResponse beginCreateOrUpdat * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).toBlocking().last().body(); + public void delete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).toBlocking().last().body(); } /** @@ -298,7 +297,7 @@ public OperationStatusResponseInner delete(String resourceGroupName, String vmSc * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName), serviceCallback); } @@ -311,10 +310,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -329,7 +328,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -342,9 +341,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -356,10 +355,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).toBlocking().single().body(); } /** @@ -372,7 +370,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName), serviceCallback); } @@ -383,12 +381,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. * @param vmssExtensionName The name of the VM scale set extension. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -401,9 +399,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -416,13 +414,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -431,9 +429,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -509,7 +507,7 @@ public Observable> getWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String expand = null; return service.get(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -598,7 +596,7 @@ public Observable> getWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.get(resourceGroupName, vmScaleSetName, vmssExtensionName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -719,7 +717,7 @@ public Observable>> l if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java index 35b44fa1fad..bd87b3f0a8e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java @@ -32,14 +32,18 @@ import com.microsoft.azure.management.compute.VirtualMachineScaleSetDataDisk; import com.microsoft.azure.management.compute.VirtualMachineScaleSetExtension; import com.microsoft.azure.management.compute.VirtualMachineScaleSetExtensionProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetIPConfiguration; import com.microsoft.azure.management.compute.VirtualMachineScaleSetManagedDiskParameters; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkProfile; import com.microsoft.azure.management.compute.VirtualMachineScaleSetOSDisk; import com.microsoft.azure.management.compute.VirtualMachineScaleSetOSProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetPublicIPAddressConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; import com.microsoft.azure.management.compute.VirtualMachineScaleSetSku; import com.microsoft.azure.management.compute.VirtualMachineScaleSetSkuTypes; import com.microsoft.azure.management.compute.VirtualMachineScaleSetStorageProfile; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMProfile; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdate; import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMs; import com.microsoft.azure.management.compute.WinRMConfiguration; import com.microsoft.azure.management.compute.WinRMListener; @@ -48,11 +52,13 @@ import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; import com.microsoft.azure.management.graphrbac.implementation.RoleAssignmentHelper; import com.microsoft.azure.management.msi.Identity; +import com.microsoft.azure.management.network.ApplicationSecurityGroup; import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerInboundNatPool; import com.microsoft.azure.management.network.LoadBalancerPrivateFrontend; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.Network; +import com.microsoft.azure.management.network.NetworkSecurityGroup; import com.microsoft.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.microsoft.azure.management.network.implementation.NetworkManager; import com.microsoft.azure.management.resources.fluentcore.arm.AvailabilityZoneId; @@ -196,7 +202,7 @@ public void deallocate() { @Override public Completable deallocateAsync() { - Observable d = this.manager().inner().virtualMachineScaleSets().deallocateAsync(this.resourceGroupName(), this.name()); + Observable d = this.manager().inner().virtualMachineScaleSets().deallocateAsync(this.resourceGroupName(), this.name()); Observable r = this.refreshAsync(); return Observable.concat(d, r).toCompletable(); } @@ -411,6 +417,16 @@ public VirtualMachinePriorityTypes virtualMachinePriority() { } } + @Override + public VirtualMachineScaleSetPublicIPAddressConfiguration virtualMachinePublicIpConfig() { + VirtualMachineScaleSetIPConfiguration nicConfig = this.primaryNicDefaultIPConfiguration(); + if (nicConfig != null) { + return nicConfig.publicIPAddressConfiguration(); + } else { + return null; + } + } + @Override public VirtualMachineEvictionPolicyTypes virtualMachineEvictionPolicy() { if (this.inner().virtualMachineProfile() != null) { @@ -420,6 +436,71 @@ public VirtualMachineEvictionPolicyTypes virtualMachineEvictionPolicy() { } } + + @Override + public boolean isIpForwardingEnabled() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); + if (nicConfig.enableIPForwarding() != null) { + return nicConfig.enableIPForwarding(); + } else { + return false; + } + } + + @Override + public boolean isAcceleratedNetworkingEnabled() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); + if (nicConfig.enableAcceleratedNetworking() != null) { + return nicConfig.enableAcceleratedNetworking(); + } else { + return false; + } + } + + @Override + public String networkSecurityGroupId() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = primaryNicConfiguration(); + if (nicConfig.networkSecurityGroup() != null) { + return nicConfig.networkSecurityGroup().id(); + } else { + return null; + } + } + + @Override + public boolean isSinglePlacementGroupEnabled() { + if (this.inner().singlePlacementGroup() != null) { + return this.inner().singlePlacementGroup(); + } else { + return false; + } + } + + @Override + public List applicationGatewayBackendAddressPoolsIds() { + VirtualMachineScaleSetIPConfiguration nicIpConfig = this.primaryNicDefaultIPConfiguration(); + List backendPools = nicIpConfig.applicationGatewayBackendAddressPools(); + List result = new ArrayList<>(); + if (backendPools != null) { + for (SubResource backendPool : backendPools) { + result.add(backendPool.id()); + } + } + return result; + } + + @Override + public List applicationSecurityGroupIds() { + VirtualMachineScaleSetIPConfiguration nicIpConfig = this.primaryNicDefaultIPConfiguration(); + List asgIds = new ArrayList<>(); + if (nicIpConfig.applicationSecurityGroups() != null) { + for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { + asgIds.add(asg.id()); + } + } + return asgIds; + } + @Override public VirtualMachineScaleSetNetworkInterface getNetworkInterfaceByInstanceId(String instanceId, String name) { return this.networkManager.networkInterfaces().getByVirtualMachineScaleSetInstanceId(this.resourceGroupName(), @@ -481,7 +562,7 @@ public VirtualMachineScaleSetImpl withExistingPrimaryInternetFacingLoadBalancer( @Override public VirtualMachineScaleSetImpl withPrimaryInternetFacingLoadBalancerBackends(String... backendNames) { if (this.isInCreateMode()) { - VirtualMachineScaleSetIPConfigurationInner defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); removeAllBackendAssociationFromIpConfiguration(this.primaryInternetFacingLoadBalancer, defaultPrimaryIpConfig); associateBackEndsToIpConfiguration(this.primaryInternetFacingLoadBalancer.id(), defaultPrimaryIpConfig, @@ -495,7 +576,7 @@ public VirtualMachineScaleSetImpl withPrimaryInternetFacingLoadBalancerBackends( @Override public VirtualMachineScaleSetImpl withPrimaryInternetFacingLoadBalancerInboundNatPools(String... natPoolNames) { if (this.isInCreateMode()) { - VirtualMachineScaleSetIPConfigurationInner defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); removeAllInboundNatPoolAssociationFromIpConfiguration(this.primaryInternetFacingLoadBalancer, defaultPrimaryIpConfig); associateInboundNATPoolsToIpConfiguration(this.primaryInternetFacingLoadBalancer.id(), @@ -554,7 +635,7 @@ public VirtualMachineScaleSetImpl withExistingPrimaryInternalLoadBalancer(LoadBa @Override public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancerBackends(String... backendNames) { if (this.isInCreateMode()) { - VirtualMachineScaleSetIPConfigurationInner defaultPrimaryIpConfig = primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration defaultPrimaryIpConfig = primaryNicDefaultIPConfiguration(); removeAllBackendAssociationFromIpConfiguration(this.primaryInternalLoadBalancer, defaultPrimaryIpConfig); associateBackEndsToIpConfiguration(this.primaryInternalLoadBalancer.id(), @@ -569,7 +650,7 @@ public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancerBackends(String @Override public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancerInboundNatPools(String... natPoolNames) { if (this.isInCreateMode()) { - VirtualMachineScaleSetIPConfigurationInner defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration defaultPrimaryIpConfig = this.primaryNicDefaultIPConfiguration(); removeAllInboundNatPoolAssociationFromIpConfiguration(this.primaryInternalLoadBalancer, defaultPrimaryIpConfig); associateInboundNATPoolsToIpConfiguration(this.primaryInternalLoadBalancer.id(), @@ -643,7 +724,7 @@ public VirtualMachineScaleSetImpl withSpecificWindowsImageVersion(ImageReference .storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner() .virtualMachineProfile() - .storageProfile().withImageReference(imageReference.inner()); + .storageProfile().withImageReference(imageReference); this.inner() .virtualMachineProfile() .osProfile().withWindowsConfiguration(new WindowsConfiguration()); @@ -660,7 +741,7 @@ public VirtualMachineScaleSetImpl withSpecificWindowsImageVersion(ImageReference @Override public VirtualMachineScaleSetImpl withWindowsCustomImage(String customImageId) { - ImageReferenceInner imageReferenceInner = new ImageReferenceInner(); + ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner() .virtualMachineProfile() @@ -730,7 +811,7 @@ public VirtualMachineScaleSetImpl withSpecificLinuxImageVersion(ImageReference i .storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner() .virtualMachineProfile() - .storageProfile().withImageReference(imageReference.inner()); + .storageProfile().withImageReference(imageReference); this.inner() .virtualMachineProfile() .osProfile().withLinuxConfiguration(new LinuxConfiguration()); @@ -740,7 +821,7 @@ public VirtualMachineScaleSetImpl withSpecificLinuxImageVersion(ImageReference i @Override public VirtualMachineScaleSetImpl withLinuxCustomImage(String customImageId) { - ImageReferenceInner imageReferenceInner = new ImageReferenceInner(); + ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner() .virtualMachineProfile() @@ -1062,9 +1143,8 @@ public ResourceIdentityType managedServiceIdentityType() { @Override public Set userAssignedManagedServiceIdentityIds() { - if (this.inner().identity() != null && this.inner().identity().identityIds() != null) { - return Collections.unmodifiableSet(new HashSet(this.inner().identity().identityIds())); - + if (this.inner().identity() != null && this.inner().identity().userAssignedIdentities() != null) { + return Collections.unmodifiableSet(new HashSet(this.inner().identity().userAssignedIdentities().keySet())); } return Collections.unmodifiableSet(new HashSet()); } @@ -1281,8 +1361,8 @@ public VirtualMachineScaleSetImpl withSystemAssignedManagedServiceIdentity() { } @Override - public VirtualMachineScaleSetImpl withSystemAssignedManagedServiceIdentity(int tokenPort) { - this.virtualMachineScaleSetMsiHandler.withLocalManagedServiceIdentity(tokenPort); + public VirtualMachineScaleSetImpl withoutSystemAssignedManagedServiceIdentity() { + this.virtualMachineScaleSetMsiHandler.withoutLocalManagedServiceIdentity(); return this; } @@ -1332,7 +1412,6 @@ public VirtualMachineScaleSetImpl withoutUserAssignedManagedServiceIdentity(Stri // @Override protected void beforeCreating() { - this.virtualMachineScaleSetMsiHandler.addOrUpdateMSIExtension(this); if (this.extensions.size() > 0) { this.inner() .virtualMachineProfile() @@ -1361,7 +1440,8 @@ protected Observable createInner() { } this.handleUnManagedOSDiskContainers(); this.bootDiagnosticsHandler.handleDiagnosticsSettings(); - this.virtualMachineScaleSetMsiHandler.handleExternalIdentitySettings(); + this.virtualMachineScaleSetMsiHandler.processCreatedExternalIdentities(); + this.virtualMachineScaleSetMsiHandler.handleExternalIdentities(); return this.manager().inner().virtualMachineScaleSets() .createOrUpdateAsync(resourceGroupName(), name(), inner()); } @@ -1370,6 +1450,50 @@ protected Observable createInner() { protected void afterCreating() { this.clearCachedProperties(); this.initializeChildrenFromInner(); + this.virtualMachineScaleSetMsiHandler.clear(); + } + + @Override + public Observable updateResourceAsync() { + if (this.extensions.size() > 0) { + this.inner() + .virtualMachineProfile() + .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile()) + .extensionProfile() + .withExtensions(innersFromWrappers(this.extensions.values())); + } + this.setPrimaryIpConfigurationSubnet(); + this.setPrimaryIpConfigurationBackendsAndInboundNatPools(); + if (isManagedDiskEnabled()) { + this.managedDataDisks.setDataDisksDefaults(); + } else { + List dataDisks = this.inner() + .virtualMachineProfile() + .storageProfile() + .dataDisks(); + VirtualMachineScaleSetUnmanagedDataDiskImpl.setDataDisksDefaults(dataDisks, this.name()); + } + this.handleUnManagedOSDiskContainers(); + this.bootDiagnosticsHandler.handleDiagnosticsSettings(); + this.virtualMachineScaleSetMsiHandler.processCreatedExternalIdentities(); + // + VirtualMachineScaleSetUpdate updateParameter = VMSSPatchPayload.preparePatchPayload(this); + // + this.virtualMachineScaleSetMsiHandler.handleExternalIdentities(updateParameter); + // + final VirtualMachineScaleSetImpl self = this; + return this.manager().inner().virtualMachineScaleSets() + .updateAsync(resourceGroupName(), name(), updateParameter) + .map(new Func1() { + @Override + public VirtualMachineScaleSet call(VirtualMachineScaleSetInner vmssInner) { + setInner(vmssInner); + self.clearCachedProperties(); + self.initializeChildrenFromInner(); + self.virtualMachineScaleSetMsiHandler.clear(); + return self; + } + }); } @Override @@ -1584,7 +1708,7 @@ private void setPrimaryIpConfigurationSubnet() { return; } - VirtualMachineScaleSetIPConfigurationInner ipConfig = this.primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration ipConfig = this.primaryNicDefaultIPConfiguration(); ipConfig.withSubnet(new ApiEntityReference().withId(this.existingPrimaryNetworkSubnetNameToAssociate)); this.existingPrimaryNetworkSubnetNameToAssociate = null; } @@ -1600,7 +1724,7 @@ private void setPrimaryIpConfigurationBackendsAndInboundNatPools() { throw new RuntimeException(ioException); } - VirtualMachineScaleSetIPConfigurationInner primaryIpConfig = primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration primaryIpConfig = primaryNicDefaultIPConfiguration(); if (this.primaryInternetFacingLoadBalancer != null) { removeBackendsFromIpConfiguration(this.primaryInternetFacingLoadBalancer.id(), primaryIpConfig, @@ -1713,7 +1837,7 @@ private void loadCurrentPrimaryLoadBalancersIfAvailable() throws IOException { } String firstLoadBalancerId = null; - VirtualMachineScaleSetIPConfigurationInner ipConfig = primaryNicDefaultIPConfiguration(); + VirtualMachineScaleSetIPConfiguration ipConfig = primaryNicDefaultIPConfiguration(); if (!ipConfig.loadBalancerBackendAddressPools().isEmpty()) { firstLoadBalancerId = ResourceUtils .parentResourceIdFromResourceId(ipConfig.loadBalancerBackendAddressPools().get(0).id()); @@ -1770,16 +1894,16 @@ private void loadCurrentPrimaryLoadBalancersIfAvailable() throws IOException { } } - private VirtualMachineScaleSetIPConfigurationInner primaryNicDefaultIPConfiguration() { - List nicConfigurations = this.inner() + private VirtualMachineScaleSetIPConfiguration primaryNicDefaultIPConfiguration() { + List nicConfigurations = this.inner() .virtualMachineProfile() .networkProfile() .networkInterfaceConfigurations(); - for (VirtualMachineScaleSetNetworkConfigurationInner nicConfiguration : nicConfigurations) { + for (VirtualMachineScaleSetNetworkConfiguration nicConfiguration : nicConfigurations) { if (nicConfiguration.primary()) { if (nicConfiguration.ipConfigurations().size() > 0) { - VirtualMachineScaleSetIPConfigurationInner ipConfig = nicConfiguration.ipConfigurations().get(0); + VirtualMachineScaleSetIPConfiguration ipConfig = nicConfiguration.ipConfigurations().get(0); if (ipConfig.loadBalancerBackendAddressPools() == null) { ipConfig.withLoadBalancerBackendAddressPools(new ArrayList()); } @@ -1793,8 +1917,22 @@ private VirtualMachineScaleSetIPConfigurationInner primaryNicDefaultIPConfigurat throw new RuntimeException("Could not find the primary nic configuration or an IP configuration in it"); } + private VirtualMachineScaleSetNetworkConfiguration primaryNicConfiguration() { + List nicConfigurations = this.inner() + .virtualMachineProfile() + .networkProfile() + .networkInterfaceConfigurations(); + + for (VirtualMachineScaleSetNetworkConfiguration nicConfiguration : nicConfigurations) { + if (nicConfiguration.primary()) { + return nicConfiguration; + } + } + throw new RuntimeException("Could not find the primary nic configuration"); + } + private static void associateBackEndsToIpConfiguration(String loadBalancerId, - VirtualMachineScaleSetIPConfigurationInner ipConfig, + VirtualMachineScaleSetIPConfiguration ipConfig, String... backendNames) { List backendSubResourcesToAssociate = new ArrayList<>(); for (String backendName : backendNames) { @@ -1817,7 +1955,7 @@ private static void associateBackEndsToIpConfiguration(String loadBalancerId, } private static void associateInboundNATPoolsToIpConfiguration(String loadBalancerId, - VirtualMachineScaleSetIPConfigurationInner ipConfig, + VirtualMachineScaleSetIPConfiguration ipConfig, String... inboundNatPools) { List inboundNatPoolSubResourcesToAssociate = new ArrayList<>(); for (String inboundNatPool : inboundNatPools) { @@ -1840,7 +1978,7 @@ private static void associateInboundNATPoolsToIpConfiguration(String loadBalance } private static Map getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { String loadBalancerId = loadBalancer.id(); Map attachedBackends = new HashMap<>(); Map lbBackends = loadBalancer.backends(); @@ -1856,7 +1994,7 @@ private static Map getBackendsAssociatedWithIpConfi } private static Map getInboundNatPoolsAssociatedWithIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { String loadBalancerId = loadBalancer.id(); Map attachedInboundNatPools = new HashMap<>(); Map lbInboundNatPools = loadBalancer.inboundNatPools(); @@ -1872,7 +2010,7 @@ private static Map getInboundNatPoolsAssocia } private static void associateLoadBalancerToIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { Collection backends = loadBalancer.backends().values(); String[] backendNames = new String[backends.size()]; int i = 0; @@ -1899,13 +2037,13 @@ private static void associateLoadBalancerToIpConfiguration(LoadBalancer loadBala } private static void removeLoadBalancerAssociationFromIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { removeAllBackendAssociationFromIpConfiguration(loadBalancer, ipConfig); removeAllInboundNatPoolAssociationFromIpConfiguration(loadBalancer, ipConfig); } private static void removeAllBackendAssociationFromIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { List toRemove = new ArrayList<>(); for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { if (subResource.id().toLowerCase().startsWith(loadBalancer.id().toLowerCase() + "/")) { @@ -1919,7 +2057,7 @@ private static void removeAllBackendAssociationFromIpConfiguration(LoadBalancer } private static void removeAllInboundNatPoolAssociationFromIpConfiguration(LoadBalancer loadBalancer, - VirtualMachineScaleSetIPConfigurationInner ipConfig) { + VirtualMachineScaleSetIPConfiguration ipConfig) { List toRemove = new ArrayList<>(); for (SubResource subResource : ipConfig.loadBalancerInboundNatPools()) { if (subResource.id().toLowerCase().startsWith(loadBalancer.id().toLowerCase() + "/")) { @@ -1933,7 +2071,7 @@ private static void removeAllInboundNatPoolAssociationFromIpConfiguration(LoadBa } private static void removeBackendsFromIpConfiguration(String loadBalancerId, - VirtualMachineScaleSetIPConfigurationInner ipConfig, + VirtualMachineScaleSetIPConfiguration ipConfig, String... backendNames) { List toRemove = new ArrayList<>(); for (String backendName : backendNames) { @@ -1952,7 +2090,7 @@ private static void removeBackendsFromIpConfiguration(String loadBalancerId, } private static void removeInboundNatPoolsFromIpConfiguration(String loadBalancerId, - VirtualMachineScaleSetIPConfigurationInner ipConfig, + VirtualMachineScaleSetIPConfiguration ipConfig, String... inboundNatPoolNames) { List toRemove = new ArrayList<>(); for (String natPoolName : inboundNatPoolNames) { @@ -2068,7 +2206,7 @@ private boolean isOSDiskFromImage(VirtualMachineScaleSetOSDisk osDisk) { * @return true if the OS disk is configured to be based on custom image. */ private boolean isOsDiskFromCustomImage(VirtualMachineScaleSetStorageProfile storageProfile) { - ImageReferenceInner imageReference = storageProfile.imageReference(); + ImageReference imageReference = storageProfile.imageReference(); return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.id() != null; @@ -2081,7 +2219,7 @@ private boolean isOsDiskFromCustomImage(VirtualMachineScaleSetStorageProfile sto * @return true if the OS disk is configured to be based on platform image. */ private boolean isOSDiskFromPlatformImage(VirtualMachineScaleSetStorageProfile storageProfile) { - ImageReferenceInner imageReference = storageProfile.imageReference(); + ImageReference imageReference = storageProfile.imageReference(); return isOSDiskFromImage(storageProfile.osDisk()) && imageReference != null && imageReference.publisher() != null @@ -2103,42 +2241,12 @@ private boolean isOSDiskFromStoredImage(VirtualMachineScaleSetStorageProfile sto && osDisk.image().uri() != null; } - /* TODO Unused - private void throwIfManagedDiskEnabled(String message) { - if (this.isManagedDiskEnabled()) { - throw new UnsupportedOperationException(message); - } - }*/ - private void throwIfManagedDiskDisabled(String message) { if (!this.isManagedDiskEnabled()) { throw new UnsupportedOperationException(message); } } - - OperatingSystemTypes osTypeIntern() { - VirtualMachineScaleSetVMProfile vmProfile = this.inner().virtualMachineProfile(); - if (vmProfile != null - && vmProfile.storageProfile() != null - && vmProfile.storageProfile().osDisk() != null - && vmProfile.storageProfile().osDisk().osType() != null) { - return vmProfile.storageProfile().osDisk().osType(); - } - if (vmProfile != null - && vmProfile.osProfile() != null) { - if (vmProfile.osProfile().linuxConfiguration() != null) { - return OperatingSystemTypes.LINUX; - } - if (vmProfile.osProfile().windowsConfiguration() != null) { - return OperatingSystemTypes.WINDOWS; - } - } - // This should never hit - // - throw new RuntimeException("Unable to resolve the operating system type"); - } - @Override public VirtualMachineScaleSetImpl withBootDiagnostics() { this.bootDiagnosticsHandler.withBootDiagnostics(); @@ -2188,6 +2296,197 @@ public VirtualMachineScaleSetImpl withLowPriorityVirtualMachine(VirtualMachineEv return this; } + @Override + public VirtualMachineScaleSetImpl withVirtualMachinePublicIp() { + VirtualMachineScaleSetIPConfiguration nicIpConfig = this.primaryNicDefaultIPConfiguration(); + if (nicIpConfig.publicIPAddressConfiguration() != null) { + return this; + } else { + VirtualMachineScaleSetPublicIPAddressConfiguration pipConfig = new VirtualMachineScaleSetPublicIPAddressConfiguration(); + pipConfig.withName("pip1"); + pipConfig.withIdleTimeoutInMinutes(15); + // + nicIpConfig.withPublicIPAddressConfiguration(pipConfig); + return this; + } + } + + @Override + public VirtualMachineScaleSetImpl withVirtualMachinePublicIp(String leafDomainLabel) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = this.primaryNicDefaultIPConfiguration(); + if (nicIpConfig.publicIPAddressConfiguration() != null) { + if (nicIpConfig.publicIPAddressConfiguration().dnsSettings() != null) { + nicIpConfig.publicIPAddressConfiguration().dnsSettings().withDomainNameLabel(leafDomainLabel); + } else { + nicIpConfig.publicIPAddressConfiguration().withDnsSettings(new VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings()); + nicIpConfig.publicIPAddressConfiguration().dnsSettings().withDomainNameLabel(leafDomainLabel); + } + } else { + VirtualMachineScaleSetPublicIPAddressConfiguration pipConfig = new VirtualMachineScaleSetPublicIPAddressConfiguration(); + pipConfig.withName("pip1"); + pipConfig.withIdleTimeoutInMinutes(15); + pipConfig.withDnsSettings(new VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings()); + pipConfig.dnsSettings().withDomainNameLabel(leafDomainLabel); + nicIpConfig.withPublicIPAddressConfiguration(pipConfig); + } + return this; + } + + @Override + public VirtualMachineScaleSetImpl withVirtualMachinePublicIp(VirtualMachineScaleSetPublicIPAddressConfiguration pipConfig) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = this.primaryNicDefaultIPConfiguration(); + nicIpConfig.withPublicIPAddressConfiguration(pipConfig); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withAcceleratedNetworking() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withEnableAcceleratedNetworking(true); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutAcceleratedNetworking() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withEnableAcceleratedNetworking(false); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withIpForwarding() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withEnableIPForwarding(true); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutIpForwarding() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withEnableIPForwarding(false); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withExistingNetworkSecurityGroup(NetworkSecurityGroup networkSecurityGroup) { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withNetworkSecurityGroup(new SubResource().withId(networkSecurityGroup.id())); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withExistingNetworkSecurityGroupId(String networkSecurityGroupId) { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withNetworkSecurityGroup(new SubResource().withId(networkSecurityGroupId)); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutNetworkSecurityGroup() { + VirtualMachineScaleSetNetworkConfiguration nicConfig = this.primaryNicConfiguration(); + nicConfig.withNetworkSecurityGroup(null); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withSinglePlacementGroup() { + this.inner().withSinglePlacementGroup(true); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutSinglePlacementGroup() { + this.inner().withSinglePlacementGroup(false); + return this; + } + + @Override + public VirtualMachineScaleSetImpl withExistingApplicationGatewayBackendPool(String backendPoolId) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = primaryNicDefaultIPConfiguration(); + if (nicIpConfig.applicationGatewayBackendAddressPools() == null) { + nicIpConfig.withApplicationGatewayBackendAddressPools(new ArrayList()); + } + boolean found = false; + for (SubResource backendPool : nicIpConfig.applicationGatewayBackendAddressPools()) { + if (backendPool.id().equalsIgnoreCase(backendPoolId)) { + found = true; + break; + } + } + if (!found) { + nicIpConfig.applicationGatewayBackendAddressPools().add(new SubResource().withId(backendPoolId)); + } + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutApplicationGatewayBackendPool(String backendPoolId) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = primaryNicDefaultIPConfiguration(); + if (nicIpConfig.applicationGatewayBackendAddressPools() == null) { + return this; + } else { + int foundIndex = -1; + int index = -1; + for (SubResource backendPool : nicIpConfig.applicationGatewayBackendAddressPools()) { + index = index + 1; + if (backendPool.id().equalsIgnoreCase(backendPoolId)) { + foundIndex = index; + break; + } + } + if (foundIndex != -1) { + nicIpConfig.applicationGatewayBackendAddressPools().remove(foundIndex); + } + return this; + } + } + + @Override + public VirtualMachineScaleSetImpl withExistingApplicationSecurityGroup(ApplicationSecurityGroup applicationSecurityGroup) { + return withExistingApplicationSecurityGroupId(applicationSecurityGroup.id()); + } + + @Override + public VirtualMachineScaleSetImpl withExistingApplicationSecurityGroupId(String applicationSecurityGroupId) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = primaryNicDefaultIPConfiguration(); + if (nicIpConfig.applicationSecurityGroups() == null) { + nicIpConfig.withApplicationSecurityGroups(new ArrayList()); + } + boolean found = false; + for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { + if (asg.id().equalsIgnoreCase(applicationSecurityGroupId)) { + found = true; + break; + } + } + if (!found) { + nicIpConfig.applicationSecurityGroups().add(new SubResource().withId(applicationSecurityGroupId)); + } + return this; + } + + @Override + public VirtualMachineScaleSetImpl withoutApplicationSecurityGroup(String applicationSecurityGroupId) { + VirtualMachineScaleSetIPConfiguration nicIpConfig = primaryNicDefaultIPConfiguration(); + if (nicIpConfig.applicationSecurityGroups() == null) { + return this; + } else { + int foundIndex = -1; + int index = -1; + for (SubResource asg : nicIpConfig.applicationSecurityGroups()) { + index = index + 1; + if (asg.id().equalsIgnoreCase(applicationSecurityGroupId)) { + foundIndex = index; + break; + } + } + if (foundIndex != -1) { + nicIpConfig.applicationSecurityGroups().remove(foundIndex); + } + return this; + } + } + /** * Class to manage Data Disk collection. */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInner.java index 2bc0e32a743..552d8b19edb 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInner.java @@ -105,7 +105,7 @@ public class VirtualMachineScaleSetInner extends Resource { private List zones; /** - * Get the sku value. + * Get the virtual machine scale set sku. * * @return the sku value */ @@ -114,7 +114,7 @@ public Sku sku() { } /** - * Set the sku value. + * Set the virtual machine scale set sku. * * @param sku the sku value to set * @return the VirtualMachineScaleSetInner object itself. @@ -125,7 +125,7 @@ public VirtualMachineScaleSetInner withSku(Sku sku) { } /** - * Get the plan value. + * Get specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @return the plan value */ @@ -134,7 +134,7 @@ public Plan plan() { } /** - * Set the plan value. + * Set specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @param plan the plan value to set * @return the VirtualMachineScaleSetInner object itself. @@ -145,7 +145,7 @@ public VirtualMachineScaleSetInner withPlan(Plan plan) { } /** - * Get the upgradePolicy value. + * Get the upgrade policy. * * @return the upgradePolicy value */ @@ -154,7 +154,7 @@ public UpgradePolicy upgradePolicy() { } /** - * Set the upgradePolicy value. + * Set the upgrade policy. * * @param upgradePolicy the upgradePolicy value to set * @return the VirtualMachineScaleSetInner object itself. @@ -165,7 +165,7 @@ public VirtualMachineScaleSetInner withUpgradePolicy(UpgradePolicy upgradePolicy } /** - * Get the virtualMachineProfile value. + * Get the virtual machine profile. * * @return the virtualMachineProfile value */ @@ -174,7 +174,7 @@ public VirtualMachineScaleSetVMProfile virtualMachineProfile() { } /** - * Set the virtualMachineProfile value. + * Set the virtual machine profile. * * @param virtualMachineProfile the virtualMachineProfile value to set * @return the VirtualMachineScaleSetInner object itself. @@ -185,7 +185,7 @@ public VirtualMachineScaleSetInner withVirtualMachineProfile(VirtualMachineScale } /** - * Get the provisioningState value. + * Get the provisioning state, which only appears in the response. * * @return the provisioningState value */ @@ -194,7 +194,7 @@ public String provisioningState() { } /** - * Get the overprovision value. + * Get specifies whether the Virtual Machine Scale Set should be overprovisioned. * * @return the overprovision value */ @@ -203,7 +203,7 @@ public Boolean overprovision() { } /** - * Set the overprovision value. + * Set specifies whether the Virtual Machine Scale Set should be overprovisioned. * * @param overprovision the overprovision value to set * @return the VirtualMachineScaleSetInner object itself. @@ -214,7 +214,7 @@ public VirtualMachineScaleSetInner withOverprovision(Boolean overprovision) { } /** - * Get the uniqueId value. + * Get specifies the ID which uniquely identifies a Virtual Machine Scale Set. * * @return the uniqueId value */ @@ -223,7 +223,7 @@ public String uniqueId() { } /** - * Get the singlePlacementGroup value. + * Get when true this limits the scale set to a single placement group, of max size 100 virtual machines. * * @return the singlePlacementGroup value */ @@ -232,7 +232,7 @@ public Boolean singlePlacementGroup() { } /** - * Set the singlePlacementGroup value. + * Set when true this limits the scale set to a single placement group, of max size 100 virtual machines. * * @param singlePlacementGroup the singlePlacementGroup value to set * @return the VirtualMachineScaleSetInner object itself. @@ -243,7 +243,7 @@ public VirtualMachineScaleSetInner withSinglePlacementGroup(Boolean singlePlacem } /** - * Get the zoneBalance value. + * Get whether to force stictly even Virtual Machine distribution cross x-zones in case there is zone outage. * * @return the zoneBalance value */ @@ -252,7 +252,7 @@ public Boolean zoneBalance() { } /** - * Set the zoneBalance value. + * Set whether to force stictly even Virtual Machine distribution cross x-zones in case there is zone outage. * * @param zoneBalance the zoneBalance value to set * @return the VirtualMachineScaleSetInner object itself. @@ -263,7 +263,7 @@ public VirtualMachineScaleSetInner withZoneBalance(Boolean zoneBalance) { } /** - * Get the platformFaultDomainCount value. + * Get fault Domain count for each placement group. * * @return the platformFaultDomainCount value */ @@ -272,7 +272,7 @@ public Integer platformFaultDomainCount() { } /** - * Set the platformFaultDomainCount value. + * Set fault Domain count for each placement group. * * @param platformFaultDomainCount the platformFaultDomainCount value to set * @return the VirtualMachineScaleSetInner object itself. @@ -283,7 +283,7 @@ public VirtualMachineScaleSetInner withPlatformFaultDomainCount(Integer platform } /** - * Get the identity value. + * Get the identity of the virtual machine scale set, if configured. * * @return the identity value */ @@ -292,7 +292,7 @@ public VirtualMachineScaleSetIdentity identity() { } /** - * Set the identity value. + * Set the identity of the virtual machine scale set, if configured. * * @param identity the identity value to set * @return the VirtualMachineScaleSetInner object itself. @@ -303,7 +303,7 @@ public VirtualMachineScaleSetInner withIdentity(VirtualMachineScaleSetIdentity i } /** - * Get the zones value. + * Get the virtual machine scale set zones. * * @return the zones value */ @@ -312,7 +312,7 @@ public List zones() { } /** - * Set the zones value. + * Set the virtual machine scale set zones. * * @param zones the zones value to set * @return the VirtualMachineScaleSetInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInstanceViewInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInstanceViewInner.java index b7c0f55da1d..538984a2ffe 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInstanceViewInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInstanceViewInner.java @@ -8,10 +8,10 @@ package com.microsoft.azure.management.compute.implementation; +import com.microsoft.azure.management.compute.InstanceViewStatus; import com.microsoft.azure.management.compute.VirtualMachineScaleSetInstanceViewStatusesSummary; import java.util.List; import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMExtensionsSummary; -import com.microsoft.azure.management.compute.InstanceViewStatus; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -37,7 +37,7 @@ public class VirtualMachineScaleSetInstanceViewInner { private List statuses; /** - * Get the virtualMachine value. + * Get the instance view status summary for the virtual machine scale set. * * @return the virtualMachine value */ @@ -46,7 +46,7 @@ public VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine() { } /** - * Get the extensions value. + * Get the extensions information. * * @return the extensions value */ @@ -55,7 +55,7 @@ public List extensions() { } /** - * Get the statuses value. + * Get the resource status information. * * @return the statuses value */ @@ -64,7 +64,7 @@ public List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the VirtualMachineScaleSetInstanceViewInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java index d5a1df85422..e92e6ac29c4 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java @@ -7,22 +7,23 @@ package com.microsoft.azure.management.compute.implementation; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.ResourceIdentityType; -import com.microsoft.azure.management.compute.VirtualMachineScaleSet; -import com.microsoft.azure.management.compute.VirtualMachineScaleSetExtension; import com.microsoft.azure.management.compute.VirtualMachineScaleSetIdentity; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdate; import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; import com.microsoft.azure.management.graphrbac.implementation.RoleAssignmentHelper; import com.microsoft.azure.management.msi.Identity; import com.microsoft.azure.management.resources.fluentcore.dag.TaskGroup; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; -import com.microsoft.azure.management.resources.fluentcore.utils.Utils; import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; /** * Utility class to set Managed Service Identity (MSI) property on a virtual machine scale set, @@ -31,16 +32,10 @@ */ @LangDefinition class VirtualMachineScaleSetMsiHandler extends RoleAssignmentHelper { - private static final int DEFAULT_TOKEN_PORT = 50342; - private static final String MSI_EXTENSION_PUBLISHER_NAME = "Microsoft.ManagedIdentity"; - private static final String LINUX_MSI_EXTENSION = "ManagedIdentityExtensionForLinux"; - private static final String WINDOWS_MSI_EXTENSION = "ManagedIdentityExtensionForWindows"; - private final VirtualMachineScaleSetImpl scaleSet; - private Integer tokenPort; - private boolean scheduleMSIExtensionInstallation; private List creatableIdentityKeys; + private Map userAssignedIdentities; /** * Creates VirtualMachineScaleSetMsiHandler. @@ -51,6 +46,7 @@ class VirtualMachineScaleSetMsiHandler extends RoleAssignmentHelper { super(rbacManager, scaleSet.taskGroup(), scaleSet.idProvider()); this.scaleSet = scaleSet; this.creatableIdentityKeys = new ArrayList<>(); + this.userAssignedIdentities = new HashMap<>(); } /** @@ -60,20 +56,26 @@ class VirtualMachineScaleSetMsiHandler extends RoleAssignmentHelper { * @return VirtualMachineScaleSetMsiHandler */ VirtualMachineScaleSetMsiHandler withLocalManagedServiceIdentity() { - return withLocalManagedServiceIdentity(null); + this.initVMSSIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); + return this; } /** - * Specifies that Local Managed Service Identity property needs to be enabled in the virtual machine - * scale set. + * Specifies that Local Managed Service Identity needs to be disabled in the virtual machine scale set. * - * @param port the port in the scale set VM instance to get the access token from * @return VirtualMachineScaleSetMsiHandler */ - VirtualMachineScaleSetMsiHandler withLocalManagedServiceIdentity(Integer port) { - this.initVMSSIdentity(ResourceIdentityType.SYSTEM_ASSIGNED); - this.tokenPort = port; - this.scheduleMSIExtensionInstallation = true; + VirtualMachineScaleSetMsiHandler withoutLocalManagedServiceIdentity() { + if (this.scaleSet.inner().identity() == null + || this.scaleSet.inner().identity().type() == null + || this.scaleSet.inner().identity().type().equals(ResourceIdentityType.NONE) + || this.scaleSet.inner().identity().type().equals(ResourceIdentityType.USER_ASSIGNED)) { + return this; + } else if (this.scaleSet.inner().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED)) { + this.scaleSet.inner().identity().withType(ResourceIdentityType.NONE); + } else if (this.scaleSet.inner().identity().type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { + this.scaleSet.inner().identity().withType(ResourceIdentityType.USER_ASSIGNED); + } return this; } @@ -93,8 +95,6 @@ VirtualMachineScaleSetMsiHandler withNewExternalManagedServiceIdentity(Creatable this.scaleSet.taskGroup().addDependency(dependency); this.creatableIdentityKeys.add(creatableIdentity.key()); - - this.scheduleMSIExtensionInstallation = true; return this; } @@ -107,8 +107,7 @@ VirtualMachineScaleSetMsiHandler withNewExternalManagedServiceIdentity(Creatable */ VirtualMachineScaleSetMsiHandler withExistingExternalManagedServiceIdentity(Identity identity) { this.initVMSSIdentity(ResourceIdentityType.USER_ASSIGNED); - Utils.addToListIfNotExists(this.scaleSet.inner().identity().identityIds(), identity.id()); - this.scheduleMSIExtensionInstallation = true; + this.userAssignedIdentities.put(identity.id(), new VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue()); return this; } @@ -120,135 +119,132 @@ VirtualMachineScaleSetMsiHandler withExistingExternalManagedServiceIdentity(Iden * @return VirtualMachineScaleSetMsiHandler */ VirtualMachineScaleSetMsiHandler withoutExternalManagedServiceIdentity(String identityId) { - VirtualMachineScaleSetInner scaleSetInner = this.scaleSet.inner(); - if (scaleSetInner.identity() != null && scaleSetInner.identity().identityIds() != null) { - Utils.removeFromList(scaleSetInner.identity().identityIds(), identityId); - } + this.userAssignedIdentities.put(identityId, null); return this; } /** * Update the VMSS payload model using the created External Managed Service Identities. */ - void handleExternalIdentitySettings() { + void processCreatedExternalIdentities() { for (String key : this.creatableIdentityKeys) { Identity identity = (Identity) this.scaleSet.taskGroup().taskResult(key); Objects.requireNonNull(identity); - Utils.addToListIfNotExists(this.scaleSet.inner().identity().identityIds(), identity.id()); + this.userAssignedIdentities.put(identity.id(), new VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue()); } this.creatableIdentityKeys.clear(); } - /** - * Add or update the Managed Service Identity extension for the given virtual machine scale set. - * - * @param scaleSetImpl the scale set - */ - void addOrUpdateMSIExtension(VirtualMachineScaleSetImpl scaleSetImpl) { - if (!scheduleMSIExtensionInstallation) { - return; + void handleExternalIdentities() { + if (!this.userAssignedIdentities.isEmpty()) { + this.scaleSet.inner().identity().withUserAssignedIdentities(this.userAssignedIdentities); } - // To add or update MSI extension, we relay on methods exposed from interfaces instead of from - // impl so that any breaking change in the contract cause a compile time error here. So do not - // change the below 'updateExtension' or 'defineNewExtension' to use impls. - // - String msiExtensionType = msiExtensionType(scaleSetImpl.osTypeIntern()); - VirtualMachineScaleSetExtension msiExtension = getMSIExtension(scaleSetImpl.extensions(), msiExtensionType); - if (msiExtension != null) { - Object currentTokenPortObj = msiExtension.publicSettings().get("port"); - Integer currentTokenPort = objectToInteger(currentTokenPortObj); - Integer newPort; - if (this.tokenPort != null) { - // user specified a port - newPort = this.tokenPort; - } else if (currentTokenPort != null) { - // user didn't specify a port and currently there is a port - newPort = currentTokenPort; - } else { - // user didn't specify a port and currently there is no port - newPort = DEFAULT_TOKEN_PORT; - } - VirtualMachineScaleSet.Update appliableVMSS = scaleSetImpl; - appliableVMSS.updateExtension(msiExtension.name()) - .withPublicSetting("port", newPort) - .parent(); + } + + void handleExternalIdentities(VirtualMachineScaleSetUpdate vmssUpdate) { + if (this.handleRemoveAllExternalIdentitiesCase(vmssUpdate)) { + return; } else { - Integer port; - if (this.tokenPort != null) { - port = this.tokenPort; + // At this point one of the following condition is met: + // + // 1. User don't want touch the 'VMSS.Identity.userAssignedIdentities' property + // [this.userAssignedIdentities.empty() == true] + // 2. User want to add some identities to 'VMSS.Identity.userAssignedIdentities' + // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] + // 3. User want to remove some (not all) identities in 'VMSS.Identity.userAssignedIdentities' + // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] + // Note: The scenario where this.scaleSet.inner().identity() is null in #3 is already handled in + // handleRemoveAllExternalIdentitiesCase method + // 4. User want to add and remove (all or subset) some identities in 'VMSS.Identity.userAssignedIdentities' + // [this.userAssignedIdentities.empty() == false and this.scaleSet.inner().identity() != null] + // + VirtualMachineScaleSetIdentity currentIdentity = this.scaleSet.inner().identity(); + vmssUpdate.withIdentity(currentIdentity); + if (!this.userAssignedIdentities.isEmpty()) { + // At this point its guaranteed that 'currentIdentity' is not null so vmUpdate.identity() is. + vmssUpdate.identity().withUserAssignedIdentities(this.userAssignedIdentities); } else { - port = DEFAULT_TOKEN_PORT; - } - if (scaleSetImpl.isInCreateMode()) { - VirtualMachineScaleSet.DefinitionStages.WithCreate creatableVMSS = scaleSetImpl; - creatableVMSS.defineNewExtension(msiExtensionType) - .withPublisher(MSI_EXTENSION_PUBLISHER_NAME) - .withType(msiExtensionType) - .withVersion("1.0") - .withMinorVersionAutoUpgrade() - .withPublicSetting("port", port) - .attach(); - } else { - VirtualMachineScaleSet.Update appliableVMSS = scaleSetImpl; - appliableVMSS.defineNewExtension(msiExtensionType) - .withPublisher(MSI_EXTENSION_PUBLISHER_NAME) - .withType(msiExtensionType) - .withVersion("1.0") - .withMinorVersionAutoUpgrade() - .withPublicSetting("port", port) - .attach(); + // User don't want to touch 'VM.Identity.userAssignedIdentities' property + if (currentIdentity != null) { + // and currently there is identity exists or user want to manipulate some other properties of + // identity, set identities to null so that it won't send over wire. + currentIdentity.withUserAssignedIdentities(null); + } } } - this.tokenPort = null; - this.scheduleMSIExtensionInstallation = false; } /** - * Given the OS type, gets the Managed Service Identity extension type. - * - * @param osType the os type - * - * @return the extension type. + * Clear VirtualMachineScaleSetMsiHandler post-run specific internal state. */ - private String msiExtensionType(OperatingSystemTypes osType) { - return osType == OperatingSystemTypes.LINUX ? LINUX_MSI_EXTENSION : WINDOWS_MSI_EXTENSION; + void clear() { + this.userAssignedIdentities = new HashMap<>(); } /** - * Gets the Managed Service Identity extension from the given extensions. + * Method that handle the case where user request indicates all it want to do is remove all identities associated + * with the virtual machine. * - * @param extensions the extensions - * @param typeName the extension type - * @return the MSI extension if exists, null otherwise + * @param vmssUpdate the vm update payload model + * @return true if user indented to remove all the identities. */ - private VirtualMachineScaleSetExtension getMSIExtension(Map extensions, String typeName) { - for (VirtualMachineScaleSetExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase(MSI_EXTENSION_PUBLISHER_NAME)) { - if (extension.typeName().equalsIgnoreCase(typeName)) { - return extension; + private boolean handleRemoveAllExternalIdentitiesCase(VirtualMachineScaleSetUpdate vmssUpdate) { + if (!this.userAssignedIdentities.isEmpty()) { + int rmCount = 0; + for (VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue v : this.userAssignedIdentities.values()) { + if (v == null) { + rmCount++; + } else { + break; } } - } - return null; - } - - /** - * Given an object holding a numeric in Integer or String format, convert that to - * Integer. - * - * @param obj the object - * @return the integer value - */ - private Integer objectToInteger(Object obj) { - Integer result = null; - if (obj != null) { - if (obj instanceof Integer) { - result = (Integer) obj; - } else { - result = Integer.valueOf((String) obj); + boolean containsRemoveOnly = rmCount > 0 && rmCount == this.userAssignedIdentities.size(); + // Check if user request contains only request for removal of identities. + if (containsRemoveOnly) { + Set currentIds = new HashSet<>(); + VirtualMachineScaleSetIdentity currentIdentity = this.scaleSet.inner().identity(); + if (currentIdentity != null && currentIdentity.userAssignedIdentities() != null) { + for (String id : currentIdentity.userAssignedIdentities().keySet()) { + currentIds.add(id.toLowerCase()); + } + } + Set removeIds = new HashSet<>(); + for (Map.Entry entrySet : this.userAssignedIdentities.entrySet()) { + if (entrySet.getValue() == null) { + removeIds.add(entrySet.getKey().toLowerCase()); + } + } + // If so check user want to remove all the identities + boolean removeAllCurrentIds = currentIds.size() == removeIds.size() && currentIds.containsAll(removeIds); + if (removeAllCurrentIds) { + // If so adjust the identity type [Setting type to SYSTEM_ASSIGNED orNONE will remove all the identities] + if (currentIdentity == null || currentIdentity.type() == null) { + vmssUpdate.withIdentity(new VirtualMachineScaleSetIdentity().withType(ResourceIdentityType.NONE)); + } else if (currentIdentity.type().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { + vmssUpdate.withIdentity(currentIdentity); + vmssUpdate.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); + } else if (currentIdentity.type().equals(ResourceIdentityType.USER_ASSIGNED)) { + vmssUpdate.withIdentity(currentIdentity); + vmssUpdate.identity().withType(ResourceIdentityType.NONE); + } + // and set identities property in the payload model to null so that it won't be sent + vmssUpdate.identity().withUserAssignedIdentities(null); + return true; + } else { + // Check user is asking to remove identities though there is no identities currently associated + if (currentIds.size() == 0 + && removeIds.size() != 0 + && currentIdentity == null) { + // If so we are in a invalid state but we want to send user input to service and let service + // handle it (ignore or error). + vmssUpdate.withIdentity(new VirtualMachineScaleSetIdentity().withType(ResourceIdentityType.NONE)); + vmssUpdate.identity().withUserAssignedIdentities(null); + return true; + } + } } } - return result; + return false; } /** @@ -273,11 +269,5 @@ private void initVMSSIdentity(ResourceIdentityType identityType) { } else { scaleSetInner.identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED); } - if (scaleSetInner.identity().identityIds() == null) { - if (identityType.equals(ResourceIdentityType.USER_ASSIGNED) - || identityType.equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)) { - scaleSetInner.identity().withIdentityIds(new ArrayList()); - } - } } } \ No newline at end of file diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetRollingUpgradesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetRollingUpgradesInner.java index 29bc0ff7187..96ac9a2f2c1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetRollingUpgradesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetRollingUpgradesInner.java @@ -82,10 +82,9 @@ interface VirtualMachineScaleSetRollingUpgradesService { * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner cancel(String resourceGroupName, String vmScaleSetName) { - return cancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void cancel(String resourceGroupName, String vmScaleSetName) { + cancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -97,7 +96,7 @@ public OperationStatusResponseInner cancel(String resourceGroupName, String vmSc * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture cancelAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture cancelAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -109,10 +108,10 @@ public ServiceFuture cancelAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable cancelAsync(String resourceGroupName, String vmScaleSetName) { - return cancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable cancelAsync(String resourceGroupName, String vmScaleSetName) { + return cancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -126,7 +125,7 @@ public OperationStatusResponseInner call(ServiceResponse> cancelWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -136,9 +135,9 @@ public Observable> cancelWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.cancel(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -149,10 +148,9 @@ public Observable> cancelWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginCancel(String resourceGroupName, String vmScaleSetName) { - return beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginCancel(String resourceGroupName, String vmScaleSetName) { + beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -164,7 +162,7 @@ public OperationStatusResponseInner beginCancel(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCancelAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginCancelAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -174,12 +172,12 @@ public ServiceFuture beginCancelAsync(String resou * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginCancelAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginCancelAsync(String resourceGroupName, String vmScaleSetName) { + return beginCancelWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -191,9 +189,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginCancelWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginCancelWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -203,13 +201,13 @@ public Observable> beginCancelWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCancel(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), 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 = beginCancelDelegate(response); + ServiceResponse clientResponse = beginCancelDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -218,9 +216,9 @@ public Observable> call(Response beginCancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginCancelDelegate(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()) .registerError(CloudException.class) .build(response); @@ -234,10 +232,9 @@ private ServiceResponse beginCancelDelegate(Respon * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner startOSUpgrade(String resourceGroupName, String vmScaleSetName) { - return startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { + startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -249,7 +246,7 @@ public OperationStatusResponseInner startOSUpgrade(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -261,10 +258,10 @@ public ServiceFuture startOSUpgradeAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { + return startOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -278,7 +275,7 @@ public OperationStatusResponseInner call(ServiceResponse> startOSUpgradeWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> startOSUpgradeWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -288,9 +285,9 @@ public Observable> startOSUpgradeW if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.startOSUpgrade(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -301,10 +298,9 @@ public Observable> startOSUpgradeW * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { + beginStartOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -316,7 +312,7 @@ public OperationStatusResponseInner beginStartOSUpgrade(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginStartOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -326,12 +322,12 @@ public ServiceFuture beginStartOSUpgradeAsync(Stri * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartOSUpgradeWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -343,9 +339,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginStartOSUpgradeWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginStartOSUpgradeWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -355,13 +351,13 @@ public Observable> beginStartOSUpg if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginStartOSUpgrade(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), 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 = beginStartOSUpgradeDelegate(response); + ServiceResponse clientResponse = beginStartOSUpgradeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -370,9 +366,9 @@ public Observable> call(Response beginStartOSUpgradeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginStartOSUpgradeDelegate(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()) .registerError(CloudException.class) .build(response); @@ -440,7 +436,7 @@ public Observable> getLatestWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getLatest(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetSkuInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetSkuInner.java index 4ba987fcf02..9b3e8ca20fc 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetSkuInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetSkuInner.java @@ -35,7 +35,7 @@ public class VirtualMachineScaleSetSkuInner { private VirtualMachineScaleSetSkuCapacity capacity; /** - * Get the resourceType value. + * Get the type of resource the sku applies to. * * @return the resourceType value */ @@ -44,7 +44,7 @@ public String resourceType() { } /** - * Get the sku value. + * Get the Sku. * * @return the sku value */ @@ -53,7 +53,7 @@ public Sku sku() { } /** - * Get the capacity value. + * Get specifies the number of virtual machines in the scale set. * * @return the capacity value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java index daa29e3f223..ed8e36f4699 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.compute.DataDisk; import com.microsoft.azure.management.compute.DiagnosticsProfile; import com.microsoft.azure.management.compute.ImageReference; +import com.microsoft.azure.management.compute.NetworkInterfaceReference; import com.microsoft.azure.management.compute.OSProfile; import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.PowerState; @@ -125,7 +126,7 @@ public boolean isLatestScaleSetUpdateApplied() { @Override public boolean isOSBasedOnPlatformImage() { - ImageReferenceInner imageReference = this.inner().storageProfile().imageReference(); + ImageReference imageReference = this.inner().storageProfile().imageReference(); if (imageReference != null && imageReference.publisher() != null && imageReference.sku() != null @@ -138,7 +139,7 @@ public boolean isOSBasedOnPlatformImage() { @Override public boolean isOSBasedOnCustomImage() { - ImageReferenceInner imageReference = this.inner().storageProfile().imageReference(); + ImageReference imageReference = this.inner().storageProfile().imageReference(); if (imageReference != null && imageReference.id() != null) { return true; @@ -158,7 +159,7 @@ public boolean isOSBasedOnStoredImage() { @Override public ImageReference platformImageReference() { if (isOSBasedOnPlatformImage()) { - return new ImageReference(this.inner().storageProfile().imageReference()); + return this.inner().storageProfile().imageReference(); } return null; } @@ -179,7 +180,7 @@ public VirtualMachineImage getOSPlatformImage() { @Override public VirtualMachineCustomImage getOSCustomImage() { if (this.isOSBasedOnCustomImage()) { - ImageReferenceInner imageReference = this.inner().storageProfile().imageReference(); + ImageReference imageReference = this.inner().storageProfile().imageReference(); return this.computeManager.virtualMachineCustomImages().getById(imageReference.id()); } return null; @@ -328,7 +329,7 @@ public String availabilitySetId() { @Override public List networkInterfaceIds() { List resourceIds = new ArrayList<>(); - for (NetworkInterfaceReferenceInner reference : this.inner().networkProfile().networkInterfaces()) { + for (NetworkInterfaceReference reference : this.inner().networkProfile().networkInterfaces()) { resourceIds.add(reference.id()); } return Collections.unmodifiableList(resourceIds); @@ -336,7 +337,7 @@ public List networkInterfaceIds() { @Override public String primaryNetworkInterfaceId() { - for (NetworkInterfaceReferenceInner reference : this.inner().networkProfile().networkInterfaces()) { + for (NetworkInterfaceReference reference : this.inner().networkProfile().networkInterfaces()) { if (reference.primary() != null && reference.primary()) { return reference.id(); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInner.java index 607d01d82da..9548f37da20 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInner.java @@ -146,7 +146,7 @@ public class VirtualMachineScaleSetVMInner extends Resource { private List resources; /** - * Get the instanceId value. + * Get the virtual machine instance ID. * * @return the instanceId value */ @@ -155,7 +155,7 @@ public String instanceId() { } /** - * Get the sku value. + * Get the virtual machine SKU. * * @return the sku value */ @@ -164,7 +164,7 @@ public Sku sku() { } /** - * Get the latestModelApplied value. + * Get specifies whether the latest model has been applied to the virtual machine. * * @return the latestModelApplied value */ @@ -173,7 +173,7 @@ public Boolean latestModelApplied() { } /** - * Get the vmId value. + * Get azure VM unique ID. * * @return the vmId value */ @@ -182,7 +182,7 @@ public String vmId() { } /** - * Get the instanceView value. + * Get the virtual machine instance view. * * @return the instanceView value */ @@ -191,7 +191,7 @@ public VirtualMachineInstanceView instanceView() { } /** - * Get the hardwareProfile value. + * Get specifies the hardware settings for the virtual machine. * * @return the hardwareProfile value */ @@ -200,7 +200,7 @@ public HardwareProfile hardwareProfile() { } /** - * Set the hardwareProfile value. + * Set specifies the hardware settings for the virtual machine. * * @param hardwareProfile the hardwareProfile value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -211,7 +211,7 @@ public VirtualMachineScaleSetVMInner withHardwareProfile(HardwareProfile hardwar } /** - * Get the storageProfile value. + * Get specifies the storage settings for the virtual machine disks. * * @return the storageProfile value */ @@ -220,7 +220,7 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile value. + * Set specifies the storage settings for the virtual machine disks. * * @param storageProfile the storageProfile value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -231,7 +231,7 @@ public VirtualMachineScaleSetVMInner withStorageProfile(StorageProfile storagePr } /** - * Get the osProfile value. + * Get specifies the operating system settings for the virtual machine. * * @return the osProfile value */ @@ -240,7 +240,7 @@ public OSProfile osProfile() { } /** - * Set the osProfile value. + * Set specifies the operating system settings for the virtual machine. * * @param osProfile the osProfile value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -251,7 +251,7 @@ public VirtualMachineScaleSetVMInner withOsProfile(OSProfile osProfile) { } /** - * Get the networkProfile value. + * Get specifies the network interfaces of the virtual machine. * * @return the networkProfile value */ @@ -260,7 +260,7 @@ public NetworkProfile networkProfile() { } /** - * Set the networkProfile value. + * Set specifies the network interfaces of the virtual machine. * * @param networkProfile the networkProfile value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -271,7 +271,7 @@ public VirtualMachineScaleSetVMInner withNetworkProfile(NetworkProfile networkPr } /** - * Get the diagnosticsProfile value. + * Get specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @return the diagnosticsProfile value */ @@ -280,7 +280,7 @@ public DiagnosticsProfile diagnosticsProfile() { } /** - * Set the diagnosticsProfile value. + * Set specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. * * @param diagnosticsProfile the diagnosticsProfile value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -291,7 +291,7 @@ public VirtualMachineScaleSetVMInner withDiagnosticsProfile(DiagnosticsProfile d } /** - * Get the availabilitySet value. + * Get specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. * * @return the availabilitySet value */ @@ -300,7 +300,7 @@ public SubResource availabilitySet() { } /** - * Set the availabilitySet value. + * Set specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. * * @param availabilitySet the availabilitySet value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -311,7 +311,7 @@ public VirtualMachineScaleSetVMInner withAvailabilitySet(SubResource availabilit } /** - * Get the provisioningState value. + * Get the provisioning state, which only appears in the response. * * @return the provisioningState value */ @@ -320,7 +320,7 @@ public String provisioningState() { } /** - * Get the licenseType value. + * 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. * * @return the licenseType value */ @@ -329,7 +329,7 @@ public String licenseType() { } /** - * Set the licenseType value. + * 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. * * @param licenseType the licenseType value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -340,7 +340,7 @@ public VirtualMachineScaleSetVMInner withLicenseType(String licenseType) { } /** - * Get the plan value. + * Get specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @return the plan value */ @@ -349,7 +349,7 @@ public Plan plan() { } /** - * Set the plan value. + * Set specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. * * @param plan the plan value to set * @return the VirtualMachineScaleSetVMInner object itself. @@ -360,7 +360,7 @@ public VirtualMachineScaleSetVMInner withPlan(Plan plan) { } /** - * Get the resources value. + * Get the virtual machine child extension resources. * * @return the resources value */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceViewInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceViewInner.java index d7e523a6abb..c4857936f11 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceViewInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceViewInner.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.compute.implementation; +import com.microsoft.azure.management.compute.InstanceViewStatus; import com.microsoft.azure.management.compute.VirtualMachineAgentInstanceView; import com.microsoft.azure.management.compute.MaintenanceRedeployStatus; import java.util.List; @@ -15,7 +16,6 @@ import com.microsoft.azure.management.compute.VirtualMachineExtensionInstanceView; import com.microsoft.azure.management.compute.VirtualMachineHealthStatus; import com.microsoft.azure.management.compute.BootDiagnosticsInstanceView; -import com.microsoft.azure.management.compute.InstanceViewStatus; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -95,7 +95,7 @@ public class VirtualMachineScaleSetVMInstanceViewInner { private String placementGroupId; /** - * Get the platformUpdateDomain value. + * Get the Update Domain count. * * @return the platformUpdateDomain value */ @@ -104,7 +104,7 @@ public Integer platformUpdateDomain() { } /** - * Set the platformUpdateDomain value. + * Set the Update Domain count. * * @param platformUpdateDomain the platformUpdateDomain value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -115,7 +115,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withPlatformUpdateDomain(Intege } /** - * Get the platformFaultDomain value. + * Get the Fault Domain count. * * @return the platformFaultDomain value */ @@ -124,7 +124,7 @@ public Integer platformFaultDomain() { } /** - * Set the platformFaultDomain value. + * Set the Fault Domain count. * * @param platformFaultDomain the platformFaultDomain value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -135,7 +135,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withPlatformFaultDomain(Integer } /** - * Get the rdpThumbPrint value. + * Get the Remote desktop certificate thumbprint. * * @return the rdpThumbPrint value */ @@ -144,7 +144,7 @@ public String rdpThumbPrint() { } /** - * Set the rdpThumbPrint value. + * Set the Remote desktop certificate thumbprint. * * @param rdpThumbPrint the rdpThumbPrint value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -155,7 +155,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withRdpThumbPrint(String rdpThu } /** - * Get the vmAgent value. + * Get the VM Agent running on the virtual machine. * * @return the vmAgent value */ @@ -164,7 +164,7 @@ public VirtualMachineAgentInstanceView vmAgent() { } /** - * Set the vmAgent value. + * Set the VM Agent running on the virtual machine. * * @param vmAgent the vmAgent value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -175,7 +175,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withVmAgent(VirtualMachineAgent } /** - * Get the maintenanceRedeployStatus value. + * Get the Maintenance Operation status on the virtual machine. * * @return the maintenanceRedeployStatus value */ @@ -184,7 +184,7 @@ public MaintenanceRedeployStatus maintenanceRedeployStatus() { } /** - * Set the maintenanceRedeployStatus value. + * Set the Maintenance Operation status on the virtual machine. * * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -195,7 +195,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withMaintenanceRedeployStatus(M } /** - * Get the disks value. + * Get the disks information. * * @return the disks value */ @@ -204,7 +204,7 @@ public List disks() { } /** - * Set the disks value. + * Set the disks information. * * @param disks the disks value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -215,7 +215,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withDisks(List extensions() { } /** - * Set the extensions value. + * Set the extensions information. * * @param extensions the extensions value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -235,7 +235,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withExtensions(List statuses() { } /** - * Set the statuses value. + * Set the resource status information. * * @param statuses the statuses value to set * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. @@ -284,7 +284,7 @@ public VirtualMachineScaleSetVMInstanceViewInner withStatuses(List reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -198,10 +197,10 @@ public ServiceFuture reimageAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -216,7 +215,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -229,9 +228,9 @@ public Observable> reimageWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.reimage(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -243,10 +242,9 @@ public Observable> reimageWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginReimage(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginReimage(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -259,7 +257,7 @@ public OperationStatusResponseInner beginReimage(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -270,12 +268,12 @@ public ServiceFuture beginReimageAsync(String reso * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -288,9 +286,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -303,13 +301,13 @@ public Observable> beginReimageWit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginReimage(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginReimageDelegate(response); + ServiceResponse clientResponse = beginReimageDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -318,9 +316,9 @@ public Observable> call(Response beginReimageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginReimageDelegate(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()) .registerError(CloudException.class) .build(response); @@ -335,10 +333,9 @@ private ServiceResponse beginReimageDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { + reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -351,7 +348,7 @@ public OperationStatusResponseInner reimageAll(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -364,10 +361,10 @@ public ServiceFuture reimageAllAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -382,7 +379,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -395,9 +392,9 @@ public Observable> reimageAllWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.reimageAll(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -409,10 +406,9 @@ public Observable> reimageAllWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginReimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginReimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -425,7 +421,7 @@ public OperationStatusResponseInner beginReimageAll(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -436,12 +432,12 @@ public ServiceFuture beginReimageAllAsync(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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -454,9 +450,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -469,13 +465,13 @@ public Observable> beginReimageAll if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginReimageAll(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginReimageAllDelegate(response); + ServiceResponse clientResponse = beginReimageAllDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -484,9 +480,9 @@ public Observable> call(Response beginReimageAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginReimageAllDelegate(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()) .registerError(CloudException.class) .build(response); @@ -501,10 +497,9 @@ private ServiceResponse beginReimageAllDelegate(Re * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -517,7 +512,7 @@ public OperationStatusResponseInner deallocate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -530,10 +525,10 @@ public ServiceFuture deallocateAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -548,7 +543,7 @@ public OperationStatusResponseInner call(ServiceResponse> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -561,9 +556,9 @@ public Observable> deallocateWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.deallocate(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -575,10 +570,9 @@ public Observable> deallocateWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDeallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -591,7 +585,7 @@ public OperationStatusResponseInner beginDeallocate(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -602,12 +596,12 @@ public ServiceFuture beginDeallocateAsync(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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -620,9 +614,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -635,13 +629,13 @@ public Observable> beginDeallocate if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginDeallocateDelegate(response); + ServiceResponse clientResponse = beginDeallocateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -650,9 +644,9 @@ public Observable> call(Response beginDeallocateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeallocateDelegate(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()) .registerError(CloudException.class) .build(response); @@ -735,7 +729,7 @@ public Observable> updateWithServ throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.update(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -817,7 +811,7 @@ public Observable> beginUpdateWit throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginUpdate(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -849,10 +843,9 @@ private ServiceResponse beginUpdateDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner delete(String resourceGroupName, String vmScaleSetName, String instanceId) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -865,7 +858,7 @@ public OperationStatusResponseInner delete(String resourceGroupName, String vmSc * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -878,10 +871,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -896,7 +889,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -909,9 +902,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -923,10 +916,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -939,7 +931,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -950,12 +942,12 @@ public ServiceFuture beginDeleteAsync(String resou * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -968,9 +960,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -983,13 +975,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -998,9 +990,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -1076,7 +1068,7 @@ public Observable> getWithService if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.get(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1167,7 +1159,7 @@ public Observable> ge if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getInstanceView(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1288,7 +1280,7 @@ public Observable>> listSing if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String filter = null; final String select = null; final String expand = null; @@ -1420,7 +1412,7 @@ public Observable>> listSing if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(resourceGroupName, virtualMachineScaleSetName, this.client.subscriptionId(), filter, select, expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1451,10 +1443,9 @@ private ServiceResponse> listDelegate(R * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -1467,7 +1458,7 @@ public OperationStatusResponseInner powerOff(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1480,10 +1471,10 @@ public ServiceFuture powerOffAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1498,7 +1489,7 @@ public OperationStatusResponseInner call(ServiceResponse> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1511,9 +1502,9 @@ public Observable> powerOffWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.powerOff(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1525,10 +1516,9 @@ public Observable> powerOffWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPowerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -1541,7 +1531,7 @@ public OperationStatusResponseInner beginPowerOff(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1552,12 +1542,12 @@ public ServiceFuture beginPowerOffAsync(String res * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1570,9 +1560,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1585,13 +1575,13 @@ public Observable> beginPowerOffWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginPowerOffDelegate(response); + ServiceResponse clientResponse = beginPowerOffDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1600,9 +1590,9 @@ public Observable> call(Response beginPowerOffDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPowerOffDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1617,10 +1607,9 @@ private ServiceResponse beginPowerOffDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner restart(String resourceGroupName, String vmScaleSetName, String instanceId) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -1633,7 +1622,7 @@ public OperationStatusResponseInner restart(String resourceGroupName, String vmS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1646,10 +1635,10 @@ public ServiceFuture restartAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1664,7 +1653,7 @@ public OperationStatusResponseInner call(ServiceResponse> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1677,9 +1666,9 @@ public Observable> restartWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.restart(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1691,10 +1680,9 @@ public Observable> restartWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -1707,7 +1695,7 @@ public OperationStatusResponseInner beginRestart(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1718,12 +1706,12 @@ public ServiceFuture beginRestartAsync(String reso * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1736,9 +1724,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1751,13 +1739,13 @@ public Observable> beginRestartWit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginRestart(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginRestartDelegate(response); + ServiceResponse clientResponse = beginRestartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1766,9 +1754,9 @@ public Observable> call(Response beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRestartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1783,10 +1771,9 @@ private ServiceResponse beginRestartDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner start(String resourceGroupName, String vmScaleSetName, String instanceId) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -1799,7 +1786,7 @@ public OperationStatusResponseInner start(String resourceGroupName, String vmSca * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1812,10 +1799,10 @@ public ServiceFuture startAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1830,7 +1817,7 @@ public OperationStatusResponseInner call(ServiceResponse> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1843,9 +1830,9 @@ public Observable> startWithServic if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.start(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1857,10 +1844,9 @@ public Observable> startWithServic * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginStart(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginStart(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -1873,7 +1859,7 @@ public OperationStatusResponseInner beginStart(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1884,12 +1870,12 @@ public ServiceFuture beginStartAsync(String resour * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1902,9 +1888,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1917,13 +1903,13 @@ public Observable> beginStartWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginStart(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginStartDelegate(response); + ServiceResponse clientResponse = beginStartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1932,9 +1918,9 @@ public Observable> call(Response beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginStartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1949,10 +1935,9 @@ private ServiceResponse beginStartDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -1965,7 +1950,7 @@ public OperationStatusResponseInner redeploy(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -1978,10 +1963,10 @@ public ServiceFuture redeployAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1996,7 +1981,7 @@ public OperationStatusResponseInner call(ServiceResponse> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2009,9 +1994,9 @@ public Observable> redeployWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.redeploy(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2023,10 +2008,9 @@ public Observable> redeployWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRedeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginRedeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -2039,7 +2023,7 @@ public OperationStatusResponseInner beginRedeploy(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -2050,12 +2034,12 @@ public ServiceFuture beginRedeployAsync(String res * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2068,9 +2052,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2083,13 +2067,13 @@ public Observable> beginRedeployWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginRedeployDelegate(response); + ServiceResponse clientResponse = beginRedeployDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2098,9 +2082,9 @@ public Observable> call(Response beginRedeployDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRedeployDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2115,10 +2099,9 @@ private ServiceResponse beginRedeployDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + public void performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); } /** @@ -2131,7 +2114,7 @@ public OperationStatusResponseInner performMaintenance(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -2144,10 +2127,10 @@ public ServiceFuture performMaintenanceAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2162,7 +2145,7 @@ public OperationStatusResponseInner call(ServiceResponse> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2175,9 +2158,9 @@ public Observable> performMaintena if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.performMaintenance(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2189,10 +2172,9 @@ public Observable> performMaintena * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); } /** @@ -2205,7 +2187,7 @@ public OperationStatusResponseInner beginPerformMaintenance(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } @@ -2216,12 +2198,12 @@ public ServiceFuture beginPerformMaintenanceAsync( * @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 OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2234,9 +2216,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2249,13 +2231,13 @@ public Observable> beginPerformMai if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), 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 = beginPerformMaintenanceDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2264,9 +2246,9 @@ public Observable> call(Response beginPerformMaintenanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPerformMaintenanceDelegate(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()) .registerError(CloudException.class) .build(response); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index f5c1451c6ea..9206d41bfd5 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -7,6 +7,8 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.compute.VirtualMachineScaleSet; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetIPConfiguration; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; import com.microsoft.azure.management.compute.VirtualMachineScaleSetNetworkProfile; import com.microsoft.azure.management.compute.VirtualMachineScaleSetOSDisk; import com.microsoft.azure.management.compute.VirtualMachineScaleSetOSProfile; @@ -146,16 +148,16 @@ protected VirtualMachineScaleSetImpl wrapModel(String name) { inner.virtualMachineProfile() .networkProfile() - .withNetworkInterfaceConfigurations(new ArrayList()); + .withNetworkInterfaceConfigurations(new ArrayList()); - VirtualMachineScaleSetNetworkConfigurationInner primaryNetworkInterfaceConfiguration = - new VirtualMachineScaleSetNetworkConfigurationInner() + VirtualMachineScaleSetNetworkConfiguration primaryNetworkInterfaceConfiguration = + new VirtualMachineScaleSetNetworkConfiguration() .withPrimary(true) .withName("primary-nic-cfg") - .withIpConfigurations(new ArrayList()); + .withIpConfigurations(new ArrayList()); primaryNetworkInterfaceConfiguration .ipConfigurations() - .add(new VirtualMachineScaleSetIPConfigurationInner() + .add(new VirtualMachineScaleSetIPConfiguration() .withName("primary-nic-ip-cfg")); inner.virtualMachineProfile() diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java index 9ca36448448..f3aca6913ff 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.compute.VirtualMachineScaleSetUpdate; import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMInstanceIDs; import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMInstanceRequiredIDs; import com.microsoft.azure.Page; @@ -46,7 +47,7 @@ * An instance of this class provides access to all the operations defined * in VirtualMachineScaleSets. */ -public class VirtualMachineScaleSetsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class VirtualMachineScaleSetsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private VirtualMachineScaleSetsService service; /** The service client containing this operation class. */ @@ -78,11 +79,11 @@ interface VirtualMachineScaleSetsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetUpdateInner parameters, @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("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetUpdate parameters, @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.VirtualMachineScaleSets beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}") - Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetUpdateInner parameters, @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("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetUpdate parameters, @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.VirtualMachineScaleSets delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", method = "DELETE", hasBody = true) @@ -128,6 +129,10 @@ interface VirtualMachineScaleSetsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus") Observable> listSkus(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @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.VirtualMachineScaleSets getOSUpgradeHistory" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory") + Observable> getOSUpgradeHistory(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @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.VirtualMachineScaleSets powerOff" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff") Observable> powerOff(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, @Header("User-Agent") String userAgent); @@ -208,6 +213,10 @@ interface VirtualMachineScaleSetsService { @GET Observable> listSkusNext(@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.VirtualMachineScaleSets getOSUpgradeHistoryNext" }) + @GET + Observable> getOSUpgradeHistoryNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -280,7 +289,7 @@ public Observable> createOrUpdateWi throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -355,7 +364,7 @@ public Observable> beginCreateOrUpd throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCreateOrUpdate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -389,7 +398,7 @@ private ServiceResponse beginCreateOrUpdateDelegate * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the VirtualMachineScaleSetInner object if successful. */ - public VirtualMachineScaleSetInner update(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public VirtualMachineScaleSetInner update(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).toBlocking().last().body(); } @@ -403,7 +412,7 @@ public VirtualMachineScaleSetInner update(String resourceGroupName, String vmSca * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters), serviceCallback); } @@ -416,7 +425,7 @@ public ServiceFuture updateAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public Observable updateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1, VirtualMachineScaleSetInner>() { @Override public VirtualMachineScaleSetInner call(ServiceResponse response) { @@ -434,7 +443,7 @@ public VirtualMachineScaleSetInner call(ServiceResponse> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -448,7 +457,7 @@ public Observable> updateWithServic throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.update(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -464,7 +473,7 @@ public Observable> updateWithServic * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the VirtualMachineScaleSetInner object if successful. */ - public VirtualMachineScaleSetInner beginUpdate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public VirtualMachineScaleSetInner beginUpdate(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).toBlocking().single().body(); } @@ -478,7 +487,7 @@ public VirtualMachineScaleSetInner beginUpdate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters), serviceCallback); } @@ -491,7 +500,7 @@ public ServiceFuture beginUpdateAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VirtualMachineScaleSetInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1, VirtualMachineScaleSetInner>() { @Override public VirtualMachineScaleSetInner call(ServiceResponse response) { @@ -509,7 +518,7 @@ public VirtualMachineScaleSetInner call(ServiceResponse> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdateInner parameters) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -523,7 +532,7 @@ public Observable> beginUpdateWithS throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginUpdate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -553,10 +562,9 @@ private ServiceResponse beginUpdateDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner delete(String resourceGroupName, String vmScaleSetName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void delete(String resourceGroupName, String vmScaleSetName) { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -568,7 +576,7 @@ public OperationStatusResponseInner delete(String resourceGroupName, String vmSc * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -580,10 +588,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String vmScaleSetName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -597,7 +605,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -607,9 +615,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -620,10 +628,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String vmScaleSetName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String vmScaleSetName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -635,7 +642,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -645,12 +652,12 @@ public ServiceFuture beginDeleteAsync(String resou * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -662,9 +669,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -674,13 +681,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -689,9 +696,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -760,7 +767,7 @@ public Observable> getByResourceGro if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getByResourceGroup(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -790,10 +797,9 @@ private ServiceResponse getByResourceGroupDelegate( * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner deallocate(String resourceGroupName, String vmScaleSetName) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void deallocate(String resourceGroupName, String vmScaleSetName) { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -805,7 +811,7 @@ public OperationStatusResponseInner deallocate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -817,10 +823,10 @@ public ServiceFuture deallocateAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -834,7 +840,7 @@ public OperationStatusResponseInner call(ServiceResponse> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -844,12 +850,12 @@ public Observable> deallocateWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.deallocate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * 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. @@ -860,10 +866,9 @@ public Observable> deallocateWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -876,7 +881,7 @@ public OperationStatusResponseInner deallocate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -889,10 +894,10 @@ public ServiceFuture deallocateAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -907,7 +912,7 @@ public OperationStatusResponseInner call(ServiceResponse> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -918,14 +923,14 @@ public Observable> deallocateWithS throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.deallocate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -936,10 +941,9 @@ public Observable> deallocateWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDeallocate(String resourceGroupName, String vmScaleSetName) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName) { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -951,7 +955,7 @@ public OperationStatusResponseInner beginDeallocate(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -961,12 +965,12 @@ public ServiceFuture beginDeallocateAsync(String r * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -978,9 +982,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -990,16 +994,16 @@ public Observable> beginDeallocate if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginDeallocate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginDeallocateDelegate(response); + ServiceResponse clientResponse = beginDeallocateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1017,10 +1021,9 @@ public Observable> call(Response instanceIds) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -1033,7 +1036,7 @@ public OperationStatusResponseInner beginDeallocate(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -1044,12 +1047,12 @@ public ServiceFuture beginDeallocateAsync(String r * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1062,9 +1065,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1075,18 +1078,18 @@ public Observable> beginDeallocate throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginDeallocate(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginDeallocateDelegate(response); + ServiceResponse clientResponse = beginDeallocateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1095,9 +1098,9 @@ public Observable> call(Response beginDeallocateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeallocateDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1112,10 +1115,9 @@ private ServiceResponse beginDeallocateDelegate(Re * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -1128,7 +1130,7 @@ public OperationStatusResponseInner deleteInstances(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -1141,10 +1143,10 @@ public ServiceFuture deleteInstancesAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1159,7 +1161,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> deleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1173,11 +1175,11 @@ public Observable> deleteInstances throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); Observable> observable = service.deleteInstances(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1189,10 +1191,9 @@ public Observable> deleteInstances * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -1205,7 +1206,7 @@ public OperationStatusResponseInner beginDeleteInstances(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -1216,12 +1217,12 @@ public ServiceFuture beginDeleteInstancesAsync(Str * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1234,9 +1235,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginDeleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1250,15 +1251,15 @@ public Observable> beginDeleteInst throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); return service.beginDeleteInstances(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginDeleteInstancesDelegate(response); + ServiceResponse clientResponse = beginDeleteInstancesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1267,9 +1268,9 @@ public Observable> call(Response beginDeleteInstancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeleteInstancesDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1337,7 +1338,7 @@ public Observable> getI if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getInstanceView(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1450,7 +1451,7 @@ public Observable>> listByReso if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1555,7 +1556,7 @@ public Observable>> listSingle if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1676,7 +1677,7 @@ public Observable>> listSku if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listSkus(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1698,6 +1699,127 @@ private ServiceResponse> listSkusDeleg .build(response); } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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 + * @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<UpgradeOperationHistoricalStatusInfoInner> object if successful. + */ + public PagedList getOSUpgradeHistory(final String resourceGroupName, final String vmScaleSetName) { + ServiceResponse> response = getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOSUpgradeHistoryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @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> getOSUpgradeHistoryAsync(final String resourceGroupName, final String vmScaleSetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOSUpgradeHistoryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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 to the PagedList<UpgradeOperationHistoricalStatusInfoInner> object + */ + public Observable> getOSUpgradeHistoryAsync(final String resourceGroupName, final String vmScaleSetName) { + return getOSUpgradeHistoryWithServiceResponseAsync(resourceGroupName, vmScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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 to the PagedList<UpgradeOperationHistoricalStatusInfoInner> object + */ + public Observable>> getOSUpgradeHistoryWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) { + return getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName) + .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(getOSUpgradeHistoryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UpgradeOperationHistoricalStatusInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOSUpgradeHistorySinglePageAsync(final String resourceGroupName, final String vmScaleSetName) { + 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.getOSUpgradeHistory(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOSUpgradeHistoryDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOSUpgradeHistoryDelegate(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); + } + /** * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. * @@ -1706,10 +1828,9 @@ private ServiceResponse> listSkusDeleg * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner powerOff(String resourceGroupName, String vmScaleSetName) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void powerOff(String resourceGroupName, String vmScaleSetName) { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -1721,7 +1842,7 @@ public OperationStatusResponseInner powerOff(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -1733,10 +1854,10 @@ public ServiceFuture powerOffAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1750,7 +1871,7 @@ public OperationStatusResponseInner call(ServiceResponse> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1760,12 +1881,12 @@ public Observable> powerOffWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.powerOff(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -1776,10 +1897,9 @@ public Observable> powerOffWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -1792,7 +1912,7 @@ public OperationStatusResponseInner powerOff(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -1805,10 +1925,10 @@ public ServiceFuture powerOffAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1823,7 +1943,7 @@ public OperationStatusResponseInner call(ServiceResponse> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1834,14 +1954,14 @@ public Observable> powerOffWithSer throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.powerOff(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1852,10 +1972,9 @@ public Observable> powerOffWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPowerOff(String resourceGroupName, String vmScaleSetName) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName) { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -1867,7 +1986,7 @@ public OperationStatusResponseInner beginPowerOff(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -1877,12 +1996,12 @@ public ServiceFuture beginPowerOffAsync(String res * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1894,9 +2013,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1906,16 +2025,16 @@ public Observable> beginPowerOffWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginPowerOffDelegate(response); + ServiceResponse clientResponse = beginPowerOffDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1933,10 +2052,9 @@ public Observable> call(Response instanceIds) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -1949,7 +2067,7 @@ public OperationStatusResponseInner beginPowerOff(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -1960,12 +2078,12 @@ public ServiceFuture beginPowerOffAsync(String res * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1978,9 +2096,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1991,18 +2109,18 @@ public Observable> beginPowerOffWi throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginPowerOff(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginPowerOffDelegate(response); + ServiceResponse clientResponse = beginPowerOffDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2011,9 +2129,9 @@ public Observable> call(Response beginPowerOffDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPowerOffDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2027,10 +2145,9 @@ private ServiceResponse beginPowerOffDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner restart(String resourceGroupName, String vmScaleSetName) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void restart(String resourceGroupName, String vmScaleSetName) { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -2042,7 +2159,7 @@ public OperationStatusResponseInner restart(String resourceGroupName, String vmS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2054,10 +2171,10 @@ public ServiceFuture restartAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable restartAsync(String resourceGroupName, String vmScaleSetName) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2071,7 +2188,7 @@ public OperationStatusResponseInner call(ServiceResponse> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2081,12 +2198,12 @@ public Observable> restartWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.restart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Restarts one or more virtual machines in a VM scale set. @@ -2097,10 +2214,9 @@ public Observable> restartWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner restart(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void restart(String resourceGroupName, String vmScaleSetName, List instanceIds) { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -2113,7 +2229,7 @@ public OperationStatusResponseInner restart(String resourceGroupName, String vmS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2126,10 +2242,10 @@ public ServiceFuture restartAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2144,7 +2260,7 @@ public OperationStatusResponseInner call(ServiceResponse> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2155,14 +2271,14 @@ public Observable> restartWithServ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.restart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2173,10 +2289,9 @@ public Observable> restartWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRestart(String resourceGroupName, String vmScaleSetName) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginRestart(String resourceGroupName, String vmScaleSetName) { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -2188,7 +2303,7 @@ public OperationStatusResponseInner beginRestart(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2198,12 +2313,12 @@ public ServiceFuture beginRestartAsync(String reso * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2215,9 +2330,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2227,16 +2342,16 @@ public Observable> beginRestartWit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginRestart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginRestartDelegate(response); + ServiceResponse clientResponse = beginRestartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2254,10 +2369,9 @@ public Observable> call(Response instanceIds) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -2270,7 +2384,7 @@ public OperationStatusResponseInner beginRestart(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2281,12 +2395,12 @@ public ServiceFuture beginRestartAsync(String reso * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2299,9 +2413,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2312,18 +2426,18 @@ public Observable> beginRestartWit throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginRestart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginRestartDelegate(response); + ServiceResponse clientResponse = beginRestartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2332,9 +2446,9 @@ public Observable> call(Response beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRestartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2348,10 +2462,9 @@ private ServiceResponse beginRestartDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner start(String resourceGroupName, String vmScaleSetName) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void start(String resourceGroupName, String vmScaleSetName) { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -2363,7 +2476,7 @@ public OperationStatusResponseInner start(String resourceGroupName, String vmSca * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2375,10 +2488,10 @@ public ServiceFuture startAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable startAsync(String resourceGroupName, String vmScaleSetName) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable startAsync(String resourceGroupName, String vmScaleSetName) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2392,7 +2505,7 @@ public OperationStatusResponseInner call(ServiceResponse> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2402,12 +2515,12 @@ public Observable> startWithServic if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.start(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Starts one or more virtual machines in a VM scale set. @@ -2418,10 +2531,9 @@ public Observable> startWithServic * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner start(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void start(String resourceGroupName, String vmScaleSetName, List instanceIds) { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -2434,7 +2546,7 @@ public OperationStatusResponseInner start(String resourceGroupName, String vmSca * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2447,10 +2559,10 @@ public ServiceFuture startAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2465,7 +2577,7 @@ public OperationStatusResponseInner call(ServiceResponse> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2476,14 +2588,14 @@ public Observable> startWithServic throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.start(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2494,10 +2606,9 @@ public Observable> startWithServic * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginStart(String resourceGroupName, String vmScaleSetName) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginStart(String resourceGroupName, String vmScaleSetName) { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -2509,7 +2620,7 @@ public OperationStatusResponseInner beginStart(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2519,12 +2630,12 @@ public ServiceFuture beginStartAsync(String resour * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2536,9 +2647,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2548,16 +2659,16 @@ public Observable> beginStartWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginStart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginStartDelegate(response); + ServiceResponse clientResponse = beginStartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2575,10 +2686,9 @@ public Observable> call(Response instanceIds) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginStart(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -2591,7 +2701,7 @@ public OperationStatusResponseInner beginStart(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2602,12 +2712,12 @@ public ServiceFuture beginStartAsync(String resour * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2620,9 +2730,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2633,18 +2743,18 @@ public Observable> beginStartWithS throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginStart(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginStartDelegate(response); + ServiceResponse clientResponse = beginStartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2653,9 +2763,9 @@ public Observable> call(Response beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginStartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2669,10 +2779,9 @@ private ServiceResponse beginStartDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner redeploy(String resourceGroupName, String vmScaleSetName) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void redeploy(String resourceGroupName, String vmScaleSetName) { + redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -2684,7 +2793,7 @@ public OperationStatusResponseInner redeploy(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2696,10 +2805,10 @@ public ServiceFuture redeployAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable redeployAsync(String resourceGroupName, String vmScaleSetName) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2713,7 +2822,7 @@ public OperationStatusResponseInner call(ServiceResponse> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2723,12 +2832,12 @@ public Observable> redeployWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.redeploy(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Redeploy one or more virtual machines in a VM scale set. @@ -2739,10 +2848,9 @@ public Observable> redeployWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner redeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void redeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { + redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -2755,7 +2863,7 @@ public OperationStatusResponseInner redeploy(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2768,10 +2876,10 @@ public ServiceFuture redeployAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2786,7 +2894,7 @@ public OperationStatusResponseInner call(ServiceResponse> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2797,14 +2905,14 @@ public Observable> redeployWithSer throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.redeploy(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2815,10 +2923,9 @@ public Observable> redeployWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRedeploy(String resourceGroupName, String vmScaleSetName) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginRedeploy(String resourceGroupName, String vmScaleSetName) { + beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -2830,7 +2937,7 @@ public OperationStatusResponseInner beginRedeploy(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -2840,12 +2947,12 @@ public ServiceFuture beginRedeployAsync(String res * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2857,9 +2964,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2869,16 +2976,16 @@ public Observable> beginRedeployWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginRedeploy(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginRedeployDelegate(response); + ServiceResponse clientResponse = beginRedeployDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2896,10 +3003,9 @@ public Observable> call(Response instanceIds) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginRedeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -2912,7 +3018,7 @@ public OperationStatusResponseInner beginRedeploy(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -2923,12 +3029,12 @@ public ServiceFuture beginRedeployAsync(String res * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2941,9 +3047,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2954,18 +3060,18 @@ public Observable> beginRedeployWi throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginRedeploy(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginRedeployDelegate(response); + ServiceResponse clientResponse = beginRedeployDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2974,9 +3080,9 @@ public Observable> call(Response beginRedeployDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRedeployDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2990,10 +3096,9 @@ private ServiceResponse beginRedeployDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void performMaintenance(String resourceGroupName, String vmScaleSetName) { + performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -3005,7 +3110,7 @@ public OperationStatusResponseInner performMaintenance(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3017,10 +3122,10 @@ public ServiceFuture performMaintenanceAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3034,7 +3139,7 @@ public OperationStatusResponseInner call(ServiceResponse> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3044,12 +3149,12 @@ public Observable> performMaintena if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.performMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Perform maintenance on one or more virtual machines in a VM scale set. @@ -3060,10 +3165,9 @@ public Observable> performMaintena * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void performMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { + performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -3076,7 +3180,7 @@ public OperationStatusResponseInner performMaintenance(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3089,10 +3193,10 @@ public ServiceFuture performMaintenanceAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3107,7 +3211,7 @@ public OperationStatusResponseInner call(ServiceResponse> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3118,14 +3222,14 @@ public Observable> performMaintena throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.performMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -3136,10 +3240,9 @@ public Observable> performMaintena * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmScaleSetName) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetName) { + beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -3151,7 +3254,7 @@ public OperationStatusResponseInner beginPerformMaintenance(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3161,12 +3264,12 @@ public ServiceFuture beginPerformMaintenanceAsync( * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3178,9 +3281,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3190,16 +3293,16 @@ public Observable> beginPerformMai if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginPerformMaintenanceDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3217,10 +3320,9 @@ public Observable> call(Response instanceIds) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -3233,7 +3335,7 @@ public OperationStatusResponseInner beginPerformMaintenance(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3244,12 +3346,12 @@ public ServiceFuture beginPerformMaintenanceAsync( * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3262,9 +3364,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3275,18 +3377,18 @@ public Observable> beginPerformMai throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginPerformMaintenanceDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3295,9 +3397,9 @@ public Observable> call(Response beginPerformMaintenanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPerformMaintenanceDelegate(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()) .registerError(CloudException.class) .build(response); @@ -3312,10 +3414,9 @@ private ServiceResponse beginPerformMaintenanceDel * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -3328,7 +3429,7 @@ public OperationStatusResponseInner updateInstances(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3341,10 +3442,10 @@ public ServiceFuture updateInstancesAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3359,7 +3460,7 @@ public OperationStatusResponseInner call(ServiceResponse> updateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> updateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3373,11 +3474,11 @@ public Observable> updateInstances throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); Observable> observable = service.updateInstances(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -3389,10 +3490,9 @@ public Observable> updateInstances * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginUpdateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginUpdateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -3405,7 +3505,7 @@ public OperationStatusResponseInner beginUpdateInstances(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3416,12 +3516,12 @@ public ServiceFuture beginUpdateInstancesAsync(Str * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3434,9 +3534,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginUpdateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginUpdateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3450,15 +3550,15 @@ public Observable> beginUpdateInst throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); return service.beginUpdateInstances(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginUpdateInstancesDelegate(response); + ServiceResponse clientResponse = beginUpdateInstancesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3467,9 +3567,9 @@ public Observable> call(Response beginUpdateInstancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginUpdateInstancesDelegate(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()) .registerError(CloudException.class) .build(response); @@ -3483,10 +3583,9 @@ private ServiceResponse beginUpdateInstancesDelega * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner reimage(String resourceGroupName, String vmScaleSetName) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void reimage(String resourceGroupName, String vmScaleSetName) { + reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -3498,7 +3597,7 @@ public OperationStatusResponseInner reimage(String resourceGroupName, String vmS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture reimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3510,10 +3609,10 @@ public ServiceFuture reimageAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAsync(String resourceGroupName, String vmScaleSetName) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3527,7 +3626,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3537,12 +3636,12 @@ public Observable> reimageWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.reimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -3553,10 +3652,9 @@ public Observable> reimageWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner reimage(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void reimage(String resourceGroupName, String vmScaleSetName, List instanceIds) { + reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -3569,7 +3667,7 @@ public OperationStatusResponseInner reimage(String resourceGroupName, String vmS * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3582,10 +3680,10 @@ public ServiceFuture reimageAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3600,7 +3698,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3611,14 +3709,14 @@ public Observable> reimageWithServ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.reimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -3629,10 +3727,9 @@ public Observable> reimageWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginReimage(String resourceGroupName, String vmScaleSetName) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginReimage(String resourceGroupName, String vmScaleSetName) { + beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -3644,7 +3741,7 @@ public OperationStatusResponseInner beginReimage(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3654,12 +3751,12 @@ public ServiceFuture beginReimageAsync(String reso * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3671,9 +3768,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3683,16 +3780,16 @@ public Observable> beginReimageWit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginReimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginReimageDelegate(response); + ServiceResponse clientResponse = beginReimageDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3710,10 +3807,9 @@ public Observable> call(Response instanceIds) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginReimage(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -3726,7 +3822,7 @@ public OperationStatusResponseInner beginReimage(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3737,12 +3833,12 @@ public ServiceFuture beginReimageAsync(String reso * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3755,9 +3851,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3768,18 +3864,18 @@ public Observable> beginReimageWit throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginReimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginReimageDelegate(response); + ServiceResponse clientResponse = beginReimageDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3788,9 +3884,9 @@ public Observable> call(Response beginReimageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginReimageDelegate(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()) .registerError(CloudException.class) .build(response); @@ -3804,10 +3900,9 @@ private ServiceResponse beginReimageDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + public void reimageAll(String resourceGroupName, String vmScaleSetName) { + reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** @@ -3819,7 +3914,7 @@ public OperationStatusResponseInner reimageAll(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3831,10 +3926,10 @@ public ServiceFuture reimageAllAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName) { + return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3848,7 +3943,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3858,12 +3953,12 @@ public Observable> reimageAllWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final String instanceIdsConverted = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); Observable> observable = service.reimageAll(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -3874,10 +3969,9 @@ public Observable> reimageAllWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); + public void reimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { + reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** @@ -3890,7 +3984,7 @@ public OperationStatusResponseInner reimageAll(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -3903,10 +3997,10 @@ public ServiceFuture reimageAllAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3921,7 +4015,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> reimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3932,14 +4026,14 @@ public Observable> reimageAllWithS throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } Observable> observable = service.reimageAll(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -3950,10 +4044,9 @@ public Observable> reimageAllWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginReimageAll(String resourceGroupName, String vmScaleSetName) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); + public void beginReimageAll(String resourceGroupName, String vmScaleSetName) { + beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** @@ -3965,7 +4058,7 @@ public OperationStatusResponseInner beginReimageAll(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } @@ -3975,12 +4068,12 @@ public ServiceFuture beginReimageAllAsync(String r * @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 to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName) { + return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -3992,9 +4085,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4004,16 +4097,16 @@ public Observable> beginReimageAll if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final List instanceIds = null; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(null); return service.beginReimageAll(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginReimageAllDelegate(response); + ServiceResponse clientResponse = beginReimageAllDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4031,10 +4124,9 @@ public Observable> call(Response instanceIds) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public void beginReimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** @@ -4047,7 +4139,7 @@ public OperationStatusResponseInner beginReimageAll(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + public ServiceFuture beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } @@ -4058,12 +4150,12 @@ public ServiceFuture beginReimageAllAsync(String r * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -4076,9 +4168,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginReimageAllWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4089,18 +4181,18 @@ public Observable> beginReimageAll throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } Validator.validate(instanceIds); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = null; if (instanceIds != null) { vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } return service.beginReimageAll(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, 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 = beginReimageAllDelegate(response); + ServiceResponse clientResponse = beginReimageAllDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -4109,9 +4201,9 @@ public Observable> call(Response beginReimageAllDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginReimageAllDelegate(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()) .registerError(CloudException.class) .build(response); @@ -4183,7 +4275,7 @@ public Observable> forceRecoveryServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, platformUpdateDomain, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -4538,4 +4630,115 @@ private ServiceResponse> listSkusNextD .build(response); } + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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<UpgradeOperationHistoricalStatusInfoInner> object if successful. + */ + public PagedList getOSUpgradeHistoryNext(final String nextPageLink) { + ServiceResponse> response = getOSUpgradeHistoryNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOSUpgradeHistoryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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> getOSUpgradeHistoryNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOSUpgradeHistoryNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOSUpgradeHistoryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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<UpgradeOperationHistoricalStatusInfoInner> object + */ + public Observable> getOSUpgradeHistoryNextAsync(final String nextPageLink) { + return getOSUpgradeHistoryNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @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<UpgradeOperationHistoricalStatusInfoInner> object + */ + public Observable>> getOSUpgradeHistoryNextWithServiceResponseAsync(final String nextPageLink) { + return getOSUpgradeHistoryNextSinglePageAsync(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(getOSUpgradeHistoryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UpgradeOperationHistoricalStatusInfoInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOSUpgradeHistoryNextSinglePageAsync(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.getOSUpgradeHistoryNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOSUpgradeHistoryNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOSUpgradeHistoryNextDelegate(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/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizeInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizeInner.java index c96dd606266..f9d2279c17a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizeInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizeInner.java @@ -52,7 +52,7 @@ public class VirtualMachineSizeInner { private Integer maxDataDiskCount; /** - * Get the name value. + * Get the name of the virtual machine size. * * @return the name value */ @@ -61,7 +61,7 @@ public String name() { } /** - * Set the name value. + * Set the name of the virtual machine size. * * @param name the name value to set * @return the VirtualMachineSizeInner object itself. @@ -72,7 +72,7 @@ public VirtualMachineSizeInner withName(String name) { } /** - * Get the numberOfCores value. + * Get the number of cores supported by the virtual machine size. * * @return the numberOfCores value */ @@ -81,7 +81,7 @@ public Integer numberOfCores() { } /** - * Set the numberOfCores value. + * Set the number of cores supported by the virtual machine size. * * @param numberOfCores the numberOfCores value to set * @return the VirtualMachineSizeInner object itself. @@ -92,7 +92,7 @@ public VirtualMachineSizeInner withNumberOfCores(Integer numberOfCores) { } /** - * Get the osDiskSizeInMB value. + * Get the OS disk size, in MB, allowed by the virtual machine size. * * @return the osDiskSizeInMB value */ @@ -101,7 +101,7 @@ public Integer osDiskSizeInMB() { } /** - * Set the osDiskSizeInMB value. + * Set the OS disk size, in MB, allowed by the virtual machine size. * * @param osDiskSizeInMB the osDiskSizeInMB value to set * @return the VirtualMachineSizeInner object itself. @@ -112,7 +112,7 @@ public VirtualMachineSizeInner withOsDiskSizeInMB(Integer osDiskSizeInMB) { } /** - * Get the resourceDiskSizeInMB value. + * Get the resource disk size, in MB, allowed by the virtual machine size. * * @return the resourceDiskSizeInMB value */ @@ -121,7 +121,7 @@ public Integer resourceDiskSizeInMB() { } /** - * Set the resourceDiskSizeInMB value. + * Set the resource disk size, in MB, allowed by the virtual machine size. * * @param resourceDiskSizeInMB the resourceDiskSizeInMB value to set * @return the VirtualMachineSizeInner object itself. @@ -132,7 +132,7 @@ public VirtualMachineSizeInner withResourceDiskSizeInMB(Integer resourceDiskSize } /** - * Get the memoryInMB value. + * Get the amount of memory, in MB, supported by the virtual machine size. * * @return the memoryInMB value */ @@ -141,7 +141,7 @@ public Integer memoryInMB() { } /** - * Set the memoryInMB value. + * Set the amount of memory, in MB, supported by the virtual machine size. * * @param memoryInMB the memoryInMB value to set * @return the VirtualMachineSizeInner object itself. @@ -152,7 +152,7 @@ public VirtualMachineSizeInner withMemoryInMB(Integer memoryInMB) { } /** - * Get the maxDataDiskCount value. + * Get the maximum number of data disks that can be attached to the virtual machine size. * * @return the maxDataDiskCount value */ @@ -161,7 +161,7 @@ public Integer maxDataDiskCount() { } /** - * Set the maxDataDiskCount value. + * Set the maximum number of data disks that can be attached to the virtual machine size. * * @param maxDataDiskCount the maxDataDiskCount value to set * @return the VirtualMachineSizeInner object itself. diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java index 3fbac623fa6..0fb74287df9 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java @@ -113,14 +113,18 @@ public Observable>> listWithServic if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(location, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index 2db178b9d6c..3eb62863e4e 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -10,11 +10,13 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.compute.DataDisk; import com.microsoft.azure.management.compute.HardwareProfile; +import com.microsoft.azure.management.compute.NetworkInterfaceReference; import com.microsoft.azure.management.compute.NetworkProfile; import com.microsoft.azure.management.compute.OSDisk; import com.microsoft.azure.management.compute.OSProfile; import com.microsoft.azure.management.compute.StorageProfile; import com.microsoft.azure.management.compute.VirtualMachine; +import com.microsoft.azure.management.compute.VirtualMachineCaptureParameters; import com.microsoft.azure.management.compute.VirtualMachineSizes; import com.microsoft.azure.management.compute.VirtualMachines; import com.microsoft.azure.management.graphrbac.implementation.GraphRbacManager; @@ -165,7 +167,7 @@ public String capture(String groupName, String name, @Override public Observable captureAsync(String groupName, String name, String containerName, String vhdPrefix, boolean overwriteVhd) { - VirtualMachineCaptureParametersInner parameters = new VirtualMachineCaptureParametersInner(); + VirtualMachineCaptureParameters parameters = new VirtualMachineCaptureParameters(); parameters.withDestinationContainerName(containerName); parameters.withOverwriteVhds(overwriteVhd); parameters.withVhdPrefix(vhdPrefix); @@ -179,7 +181,7 @@ public String call(VirtualMachineCaptureResultInner innerResult) { ObjectMapper mapper = new ObjectMapper(); //Object to JSON string try { - return mapper.writeValueAsString(innerResult.output()); + return mapper.writeValueAsString(innerResult); } catch (JsonProcessingException e) { throw Exceptions.propagate(e); } @@ -225,7 +227,7 @@ protected VirtualMachineImpl wrapModel(String name) { inner.withOsProfile(new OSProfile()); inner.withHardwareProfile(new HardwareProfile()); inner.withNetworkProfile(new NetworkProfile() - .withNetworkInterfaces(new ArrayList())); + .withNetworkInterfaces(new ArrayList())); return new VirtualMachineImpl(name, inner, this.manager(), diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java index 3544af99ba9..df5d82c1dca 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.compute.implementation; +import com.microsoft.azure.management.compute.InstanceViewStatus; import com.microsoft.azure.management.compute.VirtualMachineInstanceView; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; @@ -18,6 +19,9 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.compute.InstanceViewTypes; +import com.microsoft.azure.management.compute.RunCommandInput; +import com.microsoft.azure.management.compute.VirtualMachineCaptureParameters; +import com.microsoft.azure.management.compute.VirtualMachineUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -32,6 +36,7 @@ import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; +import retrofit2.http.PATCH; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.PUT; @@ -40,12 +45,14 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined * in VirtualMachines. */ -public class VirtualMachinesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { +public class VirtualMachinesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { /** The Retrofit service to perform REST calls. */ private VirtualMachinesService service; /** The service client containing this operation class. */ @@ -69,11 +76,11 @@ public VirtualMachinesInner(Retrofit retrofit, ComputeManagementClientImpl clien interface VirtualMachinesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachines capture" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture") - Observable> capture(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineCaptureParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> capture(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineCaptureParameters parameters, @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.VirtualMachines beginCapture" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture") - Observable> beginCapture(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineCaptureParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCapture(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineCaptureParameters parameters, @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.VirtualMachines createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") @@ -83,6 +90,14 @@ interface VirtualMachinesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineInner parameters, @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.VirtualMachines update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineUpdate parameters, @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.VirtualMachines beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineUpdate parameters, @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.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); @@ -173,11 +188,11 @@ interface VirtualMachinesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachines runCommand" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand") - Observable> runCommand(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body RunCommandInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> runCommand(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body RunCommandInput parameters, @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.VirtualMachines beginRunCommand" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand") - Observable> beginRunCommand(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body RunCommandInputInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginRunCommand(@Path("resourceGroupName") String resourceGroupName, @Path("vmName") String vmName, @Path("subscriptionId") String subscriptionId, @Body RunCommandInput parameters, @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.VirtualMachines listByResourceGroupNext" }) @GET @@ -200,7 +215,7 @@ interface VirtualMachinesService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the VirtualMachineCaptureResultInner object if successful. */ - public VirtualMachineCaptureResultInner capture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public VirtualMachineCaptureResultInner capture(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body(); } @@ -214,7 +229,7 @@ public VirtualMachineCaptureResultInner capture(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(captureWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } @@ -227,7 +242,7 @@ public ServiceFuture captureAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineCaptureResultInner>() { @Override public VirtualMachineCaptureResultInner call(ServiceResponse response) { @@ -245,7 +260,7 @@ public VirtualMachineCaptureResultInner call(ServiceResponse> captureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable> captureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -259,9 +274,9 @@ public Observable> captureWith throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.capture(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); } /** @@ -275,7 +290,7 @@ public Observable> captureWith * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the VirtualMachineCaptureResultInner object if successful. */ - public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body(); } @@ -289,7 +304,7 @@ public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } @@ -302,7 +317,7 @@ public ServiceFuture beginCaptureAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VirtualMachineCaptureResultInner object */ - public Observable beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineCaptureResultInner>() { @Override public VirtualMachineCaptureResultInner call(ServiceResponse response) { @@ -320,7 +335,7 @@ public VirtualMachineCaptureResultInner call(ServiceResponse> beginCaptureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable> beginCaptureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -334,7 +349,7 @@ public Observable> beginCaptur throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCapture(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -427,7 +442,7 @@ public Observable> createOrUpdateWithServic throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.createOrUpdate(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -502,7 +517,7 @@ public Observable> beginCreateOrUpdateWithS throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginCreateOrUpdate(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -525,6 +540,174 @@ private ServiceResponse beginCreateOrUpdateDelegate(Respons .build(response); } + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine 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 VirtualMachineInner object if successful. + */ + public VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine 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, VirtualMachineUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + 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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.update(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine 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 VirtualMachineInner object if successful. + */ + public VirtualMachineInner beginUpdate(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine 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, VirtualMachineUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) { + 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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginUpdate(resourceGroupName, vmName, this.client.subscriptionId(), parameters, 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()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * The operation to delete a virtual machine. * @@ -533,10 +716,9 @@ private ServiceResponse beginCreateOrUpdateDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner delete(String resourceGroupName, String vmName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void delete(String resourceGroupName, String vmName) { + deleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -548,7 +730,7 @@ public OperationStatusResponseInner delete(String resourceGroupName, String vmNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture deleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -560,10 +742,10 @@ public ServiceFuture deleteAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deleteAsync(String resourceGroupName, String vmName) { - return deleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable deleteAsync(String resourceGroupName, String vmName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -577,7 +759,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -587,9 +769,9 @@ public Observable> deleteWithServi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.delete(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -600,10 +782,9 @@ public Observable> deleteWithServi * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDelete(String resourceGroupName, String vmName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginDelete(String resourceGroupName, String vmName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -615,7 +796,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -625,12 +806,12 @@ public ServiceFuture beginDeleteAsync(String resou * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeleteAsync(String resourceGroupName, String vmName) { - return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeleteAsync(String resourceGroupName, String vmName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -642,9 +823,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -654,13 +835,13 @@ public Observable> beginDeleteWith if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDelete(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginDeleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -669,9 +850,9 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + 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) @@ -740,7 +921,7 @@ public Observable> getByResourceGroupWithSe if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; final InstanceViewTypes expand = null; return service.getByResourceGroup(resourceGroupName, vmName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @@ -822,7 +1003,7 @@ public Observable> getByResourceGroupWithSe if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.getByResourceGroup(resourceGroupName, vmName, this.client.subscriptionId(), expand, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -906,7 +1087,7 @@ public Observable> instanceViewWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.instanceView(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -936,10 +1117,9 @@ private ServiceResponse instanceViewDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner convertToManagedDisks(String resourceGroupName, String vmName) { - return convertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void convertToManagedDisks(String resourceGroupName, String vmName) { + convertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -951,7 +1131,7 @@ public OperationStatusResponseInner convertToManagedDisks(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture convertToManagedDisksAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture convertToManagedDisksAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(convertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -963,10 +1143,10 @@ public ServiceFuture convertToManagedDisksAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable convertToManagedDisksAsync(String resourceGroupName, String vmName) { - return convertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable convertToManagedDisksAsync(String resourceGroupName, String vmName) { + return convertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -980,7 +1160,7 @@ public OperationStatusResponseInner call(ServiceResponse> convertToManagedDisksWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> convertToManagedDisksWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -990,9 +1170,9 @@ public Observable> convertToManage if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.convertToManagedDisks(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1003,10 +1183,9 @@ public Observable> convertToManage * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginConvertToManagedDisks(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginConvertToManagedDisks(String resourceGroupName, String vmName) { + beginConvertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -1018,7 +1197,7 @@ public OperationStatusResponseInner beginConvertToManagedDisks(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginConvertToManagedDisksAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginConvertToManagedDisksAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginConvertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1028,12 +1207,12 @@ public ServiceFuture beginConvertToManagedDisksAsy * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginConvertToManagedDisksAsync(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginConvertToManagedDisksAsync(String resourceGroupName, String vmName) { + return beginConvertToManagedDisksWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1045,9 +1224,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginConvertToManagedDisksWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginConvertToManagedDisksWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1057,13 +1236,13 @@ public Observable> beginConvertToM if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginConvertToManagedDisks(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginConvertToManagedDisksDelegate(response); + ServiceResponse clientResponse = beginConvertToManagedDisksDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1072,9 +1251,9 @@ public Observable> call(Response beginConvertToManagedDisksDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginConvertToManagedDisksDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1088,10 +1267,9 @@ private ServiceResponse beginConvertToManagedDisks * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner deallocate(String resourceGroupName, String vmName) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void deallocate(String resourceGroupName, String vmName) { + deallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -1103,7 +1281,7 @@ public OperationStatusResponseInner deallocate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture deallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(deallocateWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1115,10 +1293,10 @@ public ServiceFuture deallocateAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable deallocateAsync(String resourceGroupName, String vmName) { - return deallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable deallocateAsync(String resourceGroupName, String vmName) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1132,7 +1310,7 @@ public OperationStatusResponseInner call(ServiceResponse> deallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1142,9 +1320,9 @@ public Observable> deallocateWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.deallocate(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1155,10 +1333,9 @@ public Observable> deallocateWithS * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginDeallocate(String resourceGroupName, String vmName) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginDeallocate(String resourceGroupName, String vmName) { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -1170,7 +1347,7 @@ public OperationStatusResponseInner beginDeallocate(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginDeallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1180,12 +1357,12 @@ public ServiceFuture beginDeallocateAsync(String r * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginDeallocateAsync(String resourceGroupName, String vmName) { - return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginDeallocateAsync(String resourceGroupName, String vmName) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1197,9 +1374,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1209,13 +1386,13 @@ public Observable> beginDeallocate if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginDeallocate(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginDeallocateDelegate(response); + ServiceResponse clientResponse = beginDeallocateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1224,9 +1401,9 @@ public Observable> call(Response beginDeallocateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginDeallocateDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1240,10 +1417,9 @@ private ServiceResponse beginDeallocateDelegate(Re * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner generalize(String resourceGroupName, String vmName) { - return generalizeWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void generalize(String resourceGroupName, String vmName) { + generalizeWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -1255,7 +1431,7 @@ public OperationStatusResponseInner generalize(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture generalizeAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture generalizeAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(generalizeWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1265,12 +1441,12 @@ public ServiceFuture generalizeAsync(String resour * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable generalizeAsync(String resourceGroupName, String vmName) { - return generalizeWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable generalizeAsync(String resourceGroupName, String vmName) { + return generalizeWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1282,9 +1458,9 @@ public OperationStatusResponseInner call(ServiceResponse> generalizeWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> generalizeWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1294,13 +1470,13 @@ public Observable> generalizeWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.generalize(resourceGroupName, vmName, this.client.subscriptionId(), 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 = generalizeDelegate(response); + ServiceResponse clientResponse = generalizeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1309,9 +1485,9 @@ public Observable> call(Response generalizeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse generalizeDelegate(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); } @@ -1407,7 +1583,7 @@ public Observable>> listByResourceGrou if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1512,7 +1688,7 @@ public Observable>> listSinglePageAsyn if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -1596,14 +1772,18 @@ public Observable>> listAvailableS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.listAvailableSizes(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { ServiceResponse> result = listAvailableSizesDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1627,10 +1807,9 @@ private ServiceResponse> listAvailableSizesDel * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner powerOff(String resourceGroupName, String vmName) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void powerOff(String resourceGroupName, String vmName) { + powerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -1642,7 +1821,7 @@ public OperationStatusResponseInner powerOff(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture powerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture powerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1654,10 +1833,10 @@ public ServiceFuture powerOffAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable powerOffAsync(String resourceGroupName, String vmName) { - return powerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable powerOffAsync(String resourceGroupName, String vmName) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1671,7 +1850,7 @@ public OperationStatusResponseInner call(ServiceResponse> powerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1681,9 +1860,9 @@ public Observable> powerOffWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.powerOff(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1694,10 +1873,9 @@ public Observable> powerOffWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPowerOff(String resourceGroupName, String vmName) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginPowerOff(String resourceGroupName, String vmName) { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -1709,7 +1887,7 @@ public OperationStatusResponseInner beginPowerOff(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginPowerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1719,12 +1897,12 @@ public ServiceFuture beginPowerOffAsync(String res * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPowerOffAsync(String resourceGroupName, String vmName) { - return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPowerOffAsync(String resourceGroupName, String vmName) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1736,9 +1914,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1748,13 +1926,13 @@ public Observable> beginPowerOffWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginPowerOff(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginPowerOffDelegate(response); + ServiceResponse clientResponse = beginPowerOffDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1763,9 +1941,9 @@ public Observable> call(Response beginPowerOffDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPowerOffDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1779,10 +1957,9 @@ private ServiceResponse beginPowerOffDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner restart(String resourceGroupName, String vmName) { - return restartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void restart(String resourceGroupName, String vmName) { + restartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -1794,7 +1971,7 @@ public OperationStatusResponseInner restart(String resourceGroupName, String vmN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture restartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture restartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1806,10 +1983,10 @@ public ServiceFuture restartAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable restartAsync(String resourceGroupName, String vmName) { - return restartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable restartAsync(String resourceGroupName, String vmName) { + return restartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1823,7 +2000,7 @@ public OperationStatusResponseInner call(ServiceResponse> restartWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1833,9 +2010,9 @@ public Observable> restartWithServ if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.restart(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1846,10 +2023,9 @@ public Observable> restartWithServ * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRestart(String resourceGroupName, String vmName) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginRestart(String resourceGroupName, String vmName) { + beginRestartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -1861,7 +2037,7 @@ public OperationStatusResponseInner beginRestart(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRestartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRestartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1871,12 +2047,12 @@ public ServiceFuture beginRestartAsync(String reso * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRestartAsync(String resourceGroupName, String vmName) { - return beginRestartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRestartAsync(String resourceGroupName, String vmName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1888,9 +2064,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1900,13 +2076,13 @@ public Observable> beginRestartWit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginRestart(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginRestartDelegate(response); + ServiceResponse clientResponse = beginRestartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1915,9 +2091,9 @@ public Observable> call(Response beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRestartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -1931,10 +2107,9 @@ private ServiceResponse beginRestartDelegate(Respo * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner start(String resourceGroupName, String vmName) { - return startWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void start(String resourceGroupName, String vmName) { + startWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -1946,7 +2121,7 @@ public OperationStatusResponseInner start(String resourceGroupName, String vmNam * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture startAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture startAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -1958,10 +2133,10 @@ public ServiceFuture startAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable startAsync(String resourceGroupName, String vmName) { - return startWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable startAsync(String resourceGroupName, String vmName) { + return startWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -1975,7 +2150,7 @@ public OperationStatusResponseInner call(ServiceResponse> startWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1985,9 +2160,9 @@ public Observable> startWithServic if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.start(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -1998,10 +2173,9 @@ public Observable> startWithServic * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginStart(String resourceGroupName, String vmName) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginStart(String resourceGroupName, String vmName) { + beginStartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -2013,7 +2187,7 @@ public OperationStatusResponseInner beginStart(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginStartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginStartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -2023,12 +2197,12 @@ public ServiceFuture beginStartAsync(String resour * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginStartAsync(String resourceGroupName, String vmName) { - return beginStartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginStartAsync(String resourceGroupName, String vmName) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2040,9 +2214,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginStartWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2052,13 +2226,13 @@ public Observable> beginStartWithS if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginStart(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginStartDelegate(response); + ServiceResponse clientResponse = beginStartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2067,9 +2241,9 @@ public Observable> call(Response beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginStartDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2083,10 +2257,9 @@ private ServiceResponse beginStartDelegate(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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner redeploy(String resourceGroupName, String vmName) { - return redeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void redeploy(String resourceGroupName, String vmName) { + redeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -2098,7 +2271,7 @@ public OperationStatusResponseInner redeploy(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture redeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture redeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -2110,10 +2283,10 @@ public ServiceFuture redeployAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable redeployAsync(String resourceGroupName, String vmName) { - return redeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable redeployAsync(String resourceGroupName, String vmName) { + return redeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2127,7 +2300,7 @@ public OperationStatusResponseInner call(ServiceResponse> redeployWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2137,9 +2310,9 @@ public Observable> redeployWithSer if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.redeploy(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2150,10 +2323,9 @@ public Observable> redeployWithSer * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginRedeploy(String resourceGroupName, String vmName) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginRedeploy(String resourceGroupName, String vmName) { + beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -2165,7 +2337,7 @@ public OperationStatusResponseInner beginRedeploy(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -2175,12 +2347,12 @@ public ServiceFuture beginRedeployAsync(String res * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginRedeployAsync(String resourceGroupName, String vmName) { - return beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRedeployAsync(String resourceGroupName, String vmName) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2192,9 +2364,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2204,13 +2376,13 @@ public Observable> beginRedeployWi if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginRedeploy(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginRedeployDelegate(response); + ServiceResponse clientResponse = beginRedeployDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2219,9 +2391,9 @@ public Observable> call(Response beginRedeployDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginRedeployDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2235,10 +2407,9 @@ private ServiceResponse beginRedeployDelegate(Resp * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmName) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); + public void performMaintenance(String resourceGroupName, String vmName) { + performMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().body(); } /** @@ -2250,7 +2421,7 @@ public OperationStatusResponseInner performMaintenance(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -2262,10 +2433,10 @@ public ServiceFuture performMaintenanceAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable performMaintenanceAsync(String resourceGroupName, String vmName) { - return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable performMaintenanceAsync(String resourceGroupName, String vmName) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2279,7 +2450,7 @@ public OperationStatusResponseInner call(ServiceResponse> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2289,9 +2460,9 @@ public Observable> performMaintena if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; Observable> observable = service.performMaintenance(resourceGroupName, vmName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -2302,10 +2473,9 @@ public Observable> performMaintena * @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 OperationStatusResponseInner object if successful. */ - public OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmName) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); + public void beginPerformMaintenance(String resourceGroupName, String vmName) { + beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } /** @@ -2317,7 +2487,7 @@ public OperationStatusResponseInner beginPerformMaintenance(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -2327,12 +2497,12 @@ public ServiceFuture beginPerformMaintenanceAsync( * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatusResponseInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { - return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { @Override - public OperationStatusResponseInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); @@ -2344,9 +2514,9 @@ public OperationStatusResponseInner call(ServiceResponse> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2356,13 +2526,13 @@ public Observable> beginPerformMai if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-06-01"; return service.beginPerformMaintenance(resourceGroupName, vmName, this.client.subscriptionId(), 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 = beginPerformMaintenanceDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2371,9 +2541,9 @@ public Observable> call(Response beginPerformMaintenanceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse beginPerformMaintenanceDelegate(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()) .registerError(CloudException.class) .build(response); @@ -2388,9 +2558,9 @@ private ServiceResponse beginPerformMaintenanceDel * @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 RunCommandResultInner object if successful. + * @return the List<InstanceViewStatus> object if successful. */ - public RunCommandResultInner runCommand(String resourceGroupName, String vmName, RunCommandInputInner parameters) { + public List runCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { return runCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body(); } @@ -2404,7 +2574,7 @@ public RunCommandResultInner runCommand(String resourceGroupName, String vmName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture runCommandAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture> runCommandAsync(String resourceGroupName, String vmName, RunCommandInput parameters, final ServiceCallback> serviceCallback) { return ServiceFuture.fromResponse(runCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } @@ -2417,10 +2587,10 @@ public ServiceFuture runCommandAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable runCommandAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters) { - return runCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, RunCommandResultInner>() { + public Observable> runCommandAsync(String resourceGroupName, String vmName, RunCommandInput parameters) { + return runCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1>, List>() { @Override - public RunCommandResultInner call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); @@ -2435,7 +2605,7 @@ public RunCommandResultInner call(ServiceResponse respons * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> runCommandWithServiceResponseAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters) { + public Observable>> runCommandWithServiceResponseAsync(String resourceGroupName, String vmName, RunCommandInput parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2449,9 +2619,9 @@ public Observable> runCommandWithServiceR throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-04-01"; Observable> observable = service.runCommand(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken>() { }.getType()); } /** @@ -2463,9 +2633,9 @@ public Observable> runCommandWithServiceR * @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 RunCommandResultInner object if successful. + * @return the List<InstanceViewStatus> object if successful. */ - public RunCommandResultInner beginRunCommand(String resourceGroupName, String vmName, RunCommandInputInner parameters) { + public List beginRunCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { return beginRunCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body(); } @@ -2479,7 +2649,7 @@ public RunCommandResultInner beginRunCommand(String resourceGroupName, String vm * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginRunCommandAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture> beginRunCommandAsync(String resourceGroupName, String vmName, RunCommandInput parameters, final ServiceCallback> serviceCallback) { return ServiceFuture.fromResponse(beginRunCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } @@ -2490,12 +2660,12 @@ public ServiceFuture beginRunCommandAsync(String resource * @param vmName The name of the virtual machine. * @param parameters Parameters supplied to the Run command operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RunCommandResultInner object + * @return the observable to the List<InstanceViewStatus> object */ - public Observable beginRunCommandAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters) { - return beginRunCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, RunCommandResultInner>() { + public Observable> beginRunCommandAsync(String resourceGroupName, String vmName, RunCommandInput parameters) { + return beginRunCommandWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1>, List>() { @Override - public RunCommandResultInner call(ServiceResponse response) { + public List call(ServiceResponse> response) { return response.body(); } }); @@ -2508,9 +2678,9 @@ public RunCommandResultInner call(ServiceResponse respons * @param vmName The name of the virtual machine. * @param parameters Parameters supplied to the Run command operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the RunCommandResultInner object + * @return the observable to the List<InstanceViewStatus> object */ - public Observable> beginRunCommandWithServiceResponseAsync(String resourceGroupName, String vmName, RunCommandInputInner parameters) { + public Observable>> beginRunCommandWithServiceResponseAsync(String resourceGroupName, String vmName, RunCommandInput parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2524,13 +2694,13 @@ public Observable> beginRunCommandWithSer throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-12-01"; + final String apiVersion = "2018-04-01"; return service.beginRunCommand(resourceGroupName, vmName, this.client.subscriptionId(), parameters, 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 = beginRunCommandDelegate(response); + ServiceResponse> clientResponse = beginRunCommandDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2539,9 +2709,9 @@ public Observable> call(Response beginRunCommandDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> beginRunCommandDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java index d1559dd04cd..dccc7631978 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java @@ -8,6 +8,7 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.management.compute.implementation.ComputeManager; +import com.microsoft.azure.management.compute.implementation.VirtualMachineInner; import com.microsoft.azure.management.graphrbac.BuiltInRole; import com.microsoft.azure.management.graphrbac.RoleAssignment; import com.microsoft.azure.management.graphrbac.RoleDefinition; @@ -20,6 +21,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.Region; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; import com.microsoft.azure.management.resources.implementation.ResourceManager; +import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; import org.junit.Assert; import org.junit.Test; @@ -27,6 +29,8 @@ import rx.functions.Func1; import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -54,7 +58,30 @@ protected void cleanUpResources() { } @Test - public void canCreateVirtualMachineWithEMSI() { + public void test1() throws IOException { + AzureJacksonAdapter jacksonAdapter = new AzureJacksonAdapter(); + + Map userAssignedIdentities = new HashMap<>(); + userAssignedIdentities.put("af.B/C", new VirtualMachineIdentityUserAssignedIdentitiesValue()); + userAssignedIdentities.put("af.B/D", new VirtualMachineIdentityUserAssignedIdentitiesValue()); + + VirtualMachineIdentity identity = new VirtualMachineIdentity(); + identity.withUserAssignedIdentities(userAssignedIdentities); + // + VirtualMachineInner virtualMachine = new VirtualMachineInner(); + virtualMachine.withIdentity(identity); + + virtualMachine.withLicenseType("abs"); + // + String serialized = jacksonAdapter.serialize(virtualMachine); + // + System.out.println(serialized); + } + + @Test + public void canCreateUpdateVirtualMachineWithEMSI() { + // this.resourceManager.resourceGroups().beginDeleteByName("41522c6e938c4f6"); + RG_NAME = generateRandomResourceName("java-emsi-c-rg", 15); String identityName1 = generateRandomResourceName("msi-id", 15); String identityName2 = generateRandomResourceName("msi-id", 15); @@ -115,19 +142,6 @@ public void canCreateVirtualMachineWithEMSI() { Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); // No Local MSI enabled Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); // No Local MSI enabled - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - VirtualMachineExtension msiExtension = null; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine // Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); @@ -196,6 +210,76 @@ public void canCreateVirtualMachineWithEMSI() { .last(); Assert.assertNotNull("Expected role assignment with ROLE not found for the resource group for identity", assignment); + + emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); + Iterator itr = emsiIds.iterator(); + // Remove both (all) identities + virtualMachine.update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + // + Assert.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + if (virtualMachine.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + // fetch vm again and validate + virtualMachine.refresh(); + // + Assert.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + if (virtualMachine.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + // + itr = emsiIds.iterator(); + Identity identity1 = msiManager.identities().getById(itr.next()); + Identity identity2 = msiManager.identities().getById(itr.next()); + // + // Update VM by enabling System-MSI and add two identities + virtualMachine.update() + .withSystemAssignedManagedServiceIdentity() + .withExistingUserAssignedManagedServiceIdentity(identity1) + .withExistingUserAssignedManagedServiceIdentity(identity2) + .apply(); + + Assert.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(2, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + // + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + // + virtualMachine.refresh(); + Assert.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(2, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + // + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + // + itr = emsiIds.iterator(); + // Remove identities one by one (first one) + virtualMachine.update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + // + Assert.assertNotNull(virtualMachine.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + // Remove identities one by one (second one) + virtualMachine.update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + // + Assert.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); + // } @Test @@ -251,19 +335,6 @@ public void canCreateVirtualMachineWithLMSIAndEMSI() { Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - VirtualMachineExtension msiExtension = null; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine // Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); @@ -355,20 +426,6 @@ public void canUpdateVirtualMachineWithEMSIAndLMSI() throws Exception { .withNewUserAssignedManagedServiceIdentity(creatableIdentity) .apply(); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - VirtualMachineExtension msiExtension = null; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - - Assert.assertNotNull("Expected MSI extension not found in the virtual machine ", msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine // Set emsiIds = virtualMachine.userAssignedManagedServiceIdentityIds(); @@ -411,12 +468,39 @@ public void canUpdateVirtualMachineWithEMSIAndLMSI() throws Exception { .update() .withSystemAssignedManagedServiceIdentity() .apply(); - + // Assert.assertNotNull(virtualMachine); Assert.assertNotNull(virtualMachine.inner()); Assert.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + Assert.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + // + virtualMachine + .update() + .withoutSystemAssignedManagedServiceIdentity() + .apply(); + + Assert.assertTrue(virtualMachine.isManagedServiceIdentityEnabled()); + Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.USER_ASSIGNED)); + Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + Assert.assertEquals(1, virtualMachine.userAssignedManagedServiceIdentityIds().size()); + // + virtualMachine + .update() + .withoutUserAssignedManagedServiceIdentity(identity.id()) + .apply(); + Assert.assertFalse(virtualMachine.isManagedServiceIdentityEnabled()); + if (virtualMachine.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); + Assert.assertEquals(0, virtualMachine.userAssignedManagedServiceIdentityIds().size()); } private Observable lookupRoleAssignmentUsingScopeAndRoleAsync(final String scope, BuiltInRole role, final String principalId) { diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java index 03a6dfdd8ed..aedcf7e5bba 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java @@ -21,8 +21,6 @@ import rx.Observable; import rx.functions.Action1; -import java.util.Map; - public class VirtualMachineManagedServiceIdentityOperationsTests extends ComputeManagementTest { private static String RG_NAME = ""; private static final Region REGION = Region.US_SOUTH_CENTRAL; @@ -64,27 +62,6 @@ public void canSetMSIOnNewOrExistingVMWithoutRoleAssignment() throws Exception { Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - VirtualMachineExtension msiExtension = null; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Check the default token port - // - Map publicSettings = msiExtension.publicSettings(); - Assert.assertNotNull(publicSettings); - Assert.assertTrue(publicSettings.containsKey("port")); - Object portObj = publicSettings.get("port"); - Assert.assertNotNull(portObj); - int port = objectToInteger(portObj); - Assert.assertEquals(50342, port); // Ensure NO role assigned for resource group // @@ -101,7 +78,7 @@ public void canSetMSIOnNewOrExistingVMWithoutRoleAssignment() throws Exception { Assert.assertFalse("Resource group should not have a role assignment with virtual machine MSI principal", found); virtualMachine = virtualMachine.update() - .withSystemAssignedManagedServiceIdentity(50343) + .withSystemAssignedManagedServiceIdentity() .apply(); Assert.assertNotNull(virtualMachine); @@ -110,26 +87,6 @@ public void canSetMSIOnNewOrExistingVMWithoutRoleAssignment() throws Exception { Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityPrincipalId()); Assert.assertNotNull(virtualMachine.systemAssignedManagedServiceIdentityTenantId()); - extensions = virtualMachine.listExtensions(); - msiExtension = null; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Check the default token port - // - publicSettings = msiExtension.publicSettings(); - Assert.assertNotNull(publicSettings); - Assert.assertTrue(publicSettings.containsKey("port")); - portObj = publicSettings.get("port"); - Assert.assertNotNull(portObj); - port = objectToInteger(portObj); - Assert.assertEquals(50343, port); - // Ensure NO role assigned for resource group // rgRoleAssignments1 = rbacManager.roleAssignments().listByScope(resourceGroup.id()); @@ -199,19 +156,6 @@ public void call(Indexable indexable) { Assert.assertNotNull(servicePrincipal); Assert.assertNotNull(servicePrincipal.inner()); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - boolean extensionFound = false; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - extensionFound = true; - break; - } - } - Assert.assertTrue(extensionFound); - // Ensure role assigned // ResourceGroup resourceGroup = this.resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); @@ -288,19 +232,6 @@ public void canSetMSIOnNewVMWithMultipleRoleAssignments() throws Exception { Assert.assertNotNull(servicePrincipal); Assert.assertNotNull(servicePrincipal.inner()); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - boolean extensionFound = false; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - extensionFound = true; - break; - } - } - Assert.assertTrue(extensionFound); - // Ensure role assigned for resource group // PagedList rgRoleAssignments = rbacManager.roleAssignments().listByScope(resourceGroup.id()); @@ -354,19 +285,6 @@ public void canSetMSIOnExistingVMWithRoleAssignments() throws Exception { Assert.assertNotNull(virtualMachine.managedServiceIdentityType()); Assert.assertTrue(virtualMachine.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); - // Ensure the MSI extension is set - // - Map extensions = virtualMachine.listExtensions(); - boolean extensionFound = false; - for (VirtualMachineExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - extensionFound = true; - break; - } - } - Assert.assertTrue(extensionFound); - // Ensure NO role assigned for resource group // ResourceGroup resourceGroup = this.resourceManager.resourceGroups().getByName(virtualMachine.resourceGroupName()); diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java index ea43bcd2940..1a558689a4d 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java @@ -29,7 +29,7 @@ import rx.functions.Func1; import java.io.IOException; -import java.util.Map; +import java.util.Iterator; import java.util.Set; public class VirtualMachineScaleSetEMSILMSIOperationsTests extends TestBase { @@ -56,7 +56,7 @@ protected void cleanUpResources() { } @Test - public void canCreateVirtualMachineScaleSetWithEMSI() throws Exception { + public void canCreateUpdateVirtualMachineScaleSetWithEMSI() throws Exception { RG_NAME = generateRandomResourceName("java-ems-c-rg", 15); String identityName1 = generateRandomResourceName("msi-id", 15); String identityName2 = generateRandomResourceName("msi-id", 15); @@ -132,19 +132,6 @@ public void canCreateVirtualMachineScaleSetWithEMSI() throws Exception { Assert.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); // No Local MSI enabled Assert.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); // No Local MSI enabled - // Ensure the MSI extension is set - // - Map extensions = virtualMachineScaleSet.extensions(); - VirtualMachineScaleSetExtension msiExtension = null; - for (VirtualMachineScaleSetExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine scale set // Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); @@ -209,9 +196,91 @@ public void canCreateVirtualMachineScaleSetWithEMSI() throws Exception { .last(); Assert.assertNotNull("Expected role assignment with ROLE not found for the resource group for identity", assignment); - } + emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); + Iterator itr = emsiIds.iterator(); + // Remove both (all) identities + virtualMachineScaleSet.update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + + // + Assert.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + if (virtualMachineScaleSet.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + // fetch vm again and validate + virtualMachineScaleSet.refresh(); + // + Assert.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + if (virtualMachineScaleSet.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + // + // + itr = emsiIds.iterator(); + Identity identity1 = msiManager.identities().getById(itr.next()); + Identity identity2 = msiManager.identities().getById(itr.next()); + // + // Update VM by enabling System-MSI and add two identities + virtualMachineScaleSet.update() + .withSystemAssignedManagedServiceIdentity() + .withExistingUserAssignedManagedServiceIdentity(identity1) + .withExistingUserAssignedManagedServiceIdentity(identity2) + .apply(); + + Assert.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(2, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + // + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); + // + virtualMachineScaleSet.refresh(); + Assert.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(2, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + // + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); + // + itr = emsiIds.iterator(); + // Remove identities one by one (first one) + virtualMachineScaleSet.update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + // + Assert.assertNotNull(virtualMachineScaleSet.userAssignedManagedServiceIdentityIds()); + Assert.assertEquals(1, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)); + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); + // Remove identities one by one (second one) + virtualMachineScaleSet + .update() + .withoutUserAssignedManagedServiceIdentity(itr.next()) + .apply(); + // + Assert.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + Assert.assertNotNull(virtualMachineScaleSet.managedServiceIdentityType()); + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.SYSTEM_ASSIGNED)); + // + virtualMachineScaleSet + .update() + .withoutSystemAssignedManagedServiceIdentity() + .apply(); + Assert.assertEquals(0, virtualMachineScaleSet.userAssignedManagedServiceIdentityIds().size()); + if (virtualMachineScaleSet.managedServiceIdentityType() != null) { + Assert.assertTrue(virtualMachineScaleSet.managedServiceIdentityType().equals(ResourceIdentityType.NONE)); + } + Assert.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); + Assert.assertNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); + } @Test public void canCreateVirtualMachineScaleSetWithLMSIAndEMSI() throws Exception { @@ -283,19 +352,6 @@ public void canCreateVirtualMachineScaleSetWithLMSIAndEMSI() throws Exception { Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityPrincipalId()); Assert.assertNotNull(virtualMachineScaleSet.systemAssignedManagedServiceIdentityTenantId()); - // Ensure the MSI extension is set - // - Map extensions = virtualMachineScaleSet.extensions(); - VirtualMachineScaleSetExtension msiExtension = null; - for (VirtualMachineScaleSetExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine // Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); @@ -408,21 +464,6 @@ public void canUpdateVirtualMachineScaleSetWithEMSIAndLMSI() throws Exception { .withNewUserAssignedManagedServiceIdentity(creatableIdentity) .apply(); - // Ensure the MSI extension is set - // - Map extensions = virtualMachineScaleSet.extensions(); - VirtualMachineScaleSetExtension msiExtension = null; - for (VirtualMachineScaleSetExtension extension : extensions.values()) { - if (extension.publisherName().equalsIgnoreCase("Microsoft.ManagedIdentity") - && extension.typeName().equalsIgnoreCase("ManagedIdentityExtensionForLinux")) { - msiExtension = extension; - break; - } - } - Assert.assertNotNull(msiExtension); - - Assert.assertNotNull("Expected MSI extension not found in the virtual machine ", msiExtension); - // Ensure the "User Assigned (External) MSI" id can be retrieved from the virtual machine // Set emsiIds = virtualMachineScaleSet.userAssignedManagedServiceIdentityIds(); diff --git a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java index 5597ffac28c..e2a98b6f459 100644 --- a/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java +++ b/azure-mgmt-compute/src/test/java/com/microsoft/azure/management/compute/VirtualMachineScaleSetOperationsTests.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext; import com.microsoft.azure.management.storage.StorageAccount; import com.microsoft.azure.management.storage.StorageAccountKey; import com.microsoft.azure.storage.CloudStorageAccount; @@ -273,6 +274,116 @@ public void canCreateVirtualMachineScaleSetWithCustomScriptExtension() throws Ex } } + @Test + public void canCreateVirtualMachineScaleSetWithOptionalNetworkSettings() throws Exception { + final String vmss_name = generateRandomResourceName("vmss", 10); + final String vmssVmDnsLabel = generateRandomResourceName("pip", 10); + final String nsgName = generateRandomResourceName("nsg", 10); + final String asgName = generateRandomResourceName("asg", 8); + + ResourceGroup resourceGroup = this.resourceManager.resourceGroups() + .define(RG_NAME) + .withRegion(REGION) + .create(); + + Network network = this.networkManager + .networks() + .define("vmssvnet") + .withRegion(REGION) + .withExistingResourceGroup(resourceGroup) + .withAddressSpace("10.0.0.0/28") + .withSubnet("subnet1", "10.0.0.0/28") + .create(); + + ApplicationSecurityGroup asg = this.networkManager + .applicationSecurityGroups() + .define(asgName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroup) + .create(); + + // Create VMSS with instance public ip + VirtualMachineScaleSet virtualMachineScaleSet = this.computeManager.virtualMachineScaleSets() + .define(vmss_name) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroup) + .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2) + .withExistingPrimaryNetworkSubnet(network, "subnet1") + .withoutPrimaryInternetFacingLoadBalancer() + .withoutPrimaryInternalLoadBalancer() + .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) + .withRootUsername("jvuser") + .withRootPassword("123OData!@#123") + .withVirtualMachinePublicIp(vmssVmDnsLabel) + .withExistingApplicationSecurityGroup(asg) + .create(); + + VirtualMachineScaleSetPublicIPAddressConfiguration currentIpConfig = virtualMachineScaleSet.virtualMachinePublicIpConfig(); + + Assert.assertNotNull(currentIpConfig); + Assert.assertNotNull(currentIpConfig.dnsSettings()); + Assert.assertNotNull(currentIpConfig.dnsSettings().domainNameLabel()); + + currentIpConfig.withIdleTimeoutInMinutes(20); + + virtualMachineScaleSet.update() + .withVirtualMachinePublicIp(currentIpConfig) + .apply(); + + currentIpConfig = virtualMachineScaleSet.virtualMachinePublicIpConfig(); + Assert.assertNotNull(currentIpConfig); + Assert.assertNotNull(currentIpConfig.idleTimeoutInMinutes()); + Assert.assertEquals((long) 20, (long) currentIpConfig.idleTimeoutInMinutes()); + + virtualMachineScaleSet.refresh(); + currentIpConfig = virtualMachineScaleSet.virtualMachinePublicIpConfig(); + Assert.assertNotNull(currentIpConfig); + Assert.assertNotNull(currentIpConfig.idleTimeoutInMinutes()); + Assert.assertEquals((long) 20, (long) currentIpConfig.idleTimeoutInMinutes()); + + List asgIds = virtualMachineScaleSet.applicationSecurityGroupIds(); + Assert.assertNotNull(asgIds); + Assert.assertEquals(1, asgIds.size()); + + NetworkSecurityGroup nsg = networkManager.networkSecurityGroups().define(nsgName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroup) + .defineRule("rule1") + .allowOutbound() + .fromAnyAddress() + .fromPort(80) + .toAnyAddress() + .toPort(80) + .withProtocol(SecurityRuleProtocol.TCP) + .attach() + .create(); + + virtualMachineScaleSet.update() + .withIpForwarding() + .withAcceleratedNetworking() + .withExistingNetworkSecurityGroup(nsg) + .apply(); + + Assert.assertTrue(virtualMachineScaleSet.isIpForwardingEnabled()); + Assert.assertTrue(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); + Assert.assertNotNull(virtualMachineScaleSet.networkSecurityGroupId()); + // + virtualMachineScaleSet.refresh(); + // + Assert.assertTrue(virtualMachineScaleSet.isIpForwardingEnabled()); + Assert.assertTrue(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); + Assert.assertNotNull(virtualMachineScaleSet.networkSecurityGroupId()); + + virtualMachineScaleSet.update() + .withoutIpForwarding() + .withoutAcceleratedNetworking() + .withoutNetworkSecurityGroup() + .apply(); + Assert.assertFalse(virtualMachineScaleSet.isIpForwardingEnabled()); + Assert.assertFalse(virtualMachineScaleSet.isAcceleratedNetworkingEnabled()); + Assert.assertNull(virtualMachineScaleSet.networkSecurityGroupId()); + } + @Test public void canCreateVirtualMachineScaleSet() throws Exception { final String vmss_name = generateRandomResourceName("vmss", 10); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java index ccdf66196b2..e43c7731d41 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java @@ -8,11 +8,11 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.management.Azure; +import com.microsoft.azure.management.compute.InstanceViewStatus; import com.microsoft.azure.management.compute.KnownLinuxVirtualMachineImage; +import com.microsoft.azure.management.compute.RunCommandInput; import com.microsoft.azure.management.compute.VirtualMachine; import com.microsoft.azure.management.compute.VirtualMachineSizeTypes; -import com.microsoft.azure.management.compute.implementation.RunCommandInputInner; -import com.microsoft.azure.management.compute.implementation.RunCommandResultInner; import com.microsoft.azure.management.graphrbac.BuiltInRole; import com.microsoft.azure.management.msi.Identity; import com.microsoft.azure.management.resources.ResourceGroup; @@ -157,8 +157,8 @@ public static boolean runSample(Azure azure) { return false; } - private static RunCommandResultInner runCommandOnVM(Azure azure, VirtualMachine virtualMachine, List commands) { - RunCommandInputInner runParams = new RunCommandInputInner() + private static List runCommandOnVM(Azure azure, VirtualMachine virtualMachine, List commands) { + RunCommandInput runParams = new RunCommandInput() .withCommandId("RunShellScript") .withScript(commands); diff --git a/pom.xml b/pom.xml index 1542754be8e..dbb6317a2ab 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,19 @@ + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + + + ossrh @@ -82,12 +95,12 @@ com.microsoft.azure azure-client-runtime - 1.5.2 + 1.5.4-SNAPSHOT com.microsoft.azure azure-client-authentication - 1.5.2 + 1.5.4-SNAPSHOT com.google.guava