diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AccessLevel.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AccessLevel.java index c2dbf143ca9..47876604914 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AccessLevel.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/AccessLevel.java @@ -8,46 +8,34 @@ package com.microsoft.azure.management.compute; +import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for AccessLevel. */ -public enum AccessLevel { - /** Enum value None. */ - NONE("None"), +public final class AccessLevel extends ExpandableStringEnum { + /** Static value None for AccessLevel. */ + public static final AccessLevel NONE = fromString("None"); - /** Enum value Read. */ - READ("Read"); - - /** The actual serialized value for a AccessLevel instance. */ - private String value; - - AccessLevel(String value) { - this.value = value; - } + /** Static value Read for AccessLevel. */ + public static final AccessLevel READ = fromString("Read"); /** - * Parses a serialized value to a AccessLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed AccessLevel object, or null if unable to parse. + * Creates or finds a AccessLevel from its string representation. + * @param name a name to look for + * @return the corresponding AccessLevel */ @JsonCreator - public static AccessLevel fromString(String value) { - AccessLevel[] items = AccessLevel.values(); - for (AccessLevel item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static AccessLevel fromString(String name) { + return fromString(name, AccessLevel.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * @return known AccessLevel values + */ + public static Collection values() { + return values(AccessLevel.class); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceAgentPoolProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceAgentPoolProfile.java new file mode 100644 index 00000000000..3ed5dcb12d2 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceAgentPoolProfile.java @@ -0,0 +1,150 @@ +/** + * 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; + +/** + * Profile for the container service agent pool. + */ +public class ContainerServiceAgentPoolProfile { + /** + * Unique name of the agent pool profile in the context of the subscription + * and resource group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Number of agents (VMs) to host docker containers. Allowed values must be + * in the range of 1 to 100 (inclusive). The default value is 1. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /** + * Size of agent VMs. Possible values include: '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_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_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', + * 'Standard_G4', 'Standard_G5', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5'. + */ + @JsonProperty(value = "vmSize", required = true) + private ContainerServiceVMSizeTypes vmSize; + + /** + * DNS prefix to be used to create the FQDN for the agent pool. + */ + @JsonProperty(value = "dnsPrefix", required = true) + private String dnsPrefix; + + /** + * FDQN for the agent pool. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count value. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the vmSize value. + * + * @return the vmSize value + */ + public ContainerServiceVMSizeTypes vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize value. + * + * @param vmSize the vmSize value to set + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the dnsPrefix value. + * + * @return the dnsPrefix value + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix value. + * + * @param dnsPrefix the dnsPrefix value to set + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the fqdn value. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceCustomProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceCustomProfile.java new file mode 100644 index 00000000000..6293f6d1853 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceCustomProfile.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; + +/** + * Properties to configure a custom container service cluster. + */ +public class ContainerServiceCustomProfile { + /** + * The name of the custom orchestrator to use. + */ + @JsonProperty(value = "orchestrator", required = true) + private String orchestrator; + + /** + * Get the orchestrator value. + * + * @return the orchestrator value + */ + public String orchestrator() { + return this.orchestrator; + } + + /** + * Set the orchestrator value. + * + * @param orchestrator the orchestrator value to set + * @return the ContainerServiceCustomProfile object itself. + */ + public ContainerServiceCustomProfile withOrchestrator(String orchestrator) { + this.orchestrator = orchestrator; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceDiagnosticsProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceDiagnosticsProfile.java new file mode 100644 index 00000000000..5b978c124ab --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceDiagnosticsProfile.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 ContainerServiceDiagnosticsProfile model. + */ +public class ContainerServiceDiagnosticsProfile { + /** + * Profile for the container service VM diagnostic agent. + */ + @JsonProperty(value = "vmDiagnostics", required = true) + private ContainerServiceVMDiagnostics vmDiagnostics; + + /** + * Get the vmDiagnostics value. + * + * @return the vmDiagnostics value + */ + public ContainerServiceVMDiagnostics vmDiagnostics() { + return this.vmDiagnostics; + } + + /** + * Set the vmDiagnostics value. + * + * @param vmDiagnostics the vmDiagnostics value to set + * @return the ContainerServiceDiagnosticsProfile object itself. + */ + public ContainerServiceDiagnosticsProfile withVmDiagnostics(ContainerServiceVMDiagnostics vmDiagnostics) { + this.vmDiagnostics = vmDiagnostics; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceLinuxProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceLinuxProfile.java new file mode 100644 index 00000000000..5d3e07099aa --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceLinuxProfile.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; + +/** + * Profile for Linux VMs in the container service cluster. + */ +public class ContainerServiceLinuxProfile { + /** + * The administrator username to use for Linux VMs. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /** + * The ssh key configuration for Linux VMs. + */ + @JsonProperty(value = "ssh", required = true) + private ContainerServiceSshConfiguration ssh; + + /** + * Get the adminUsername value. + * + * @return the adminUsername value + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername value. + * + * @param adminUsername the adminUsername value to set + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the ssh value. + * + * @return the ssh value + */ + public ContainerServiceSshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh value. + * + * @param ssh the ssh value to set + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withSsh(ContainerServiceSshConfiguration ssh) { + this.ssh = ssh; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceMasterProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceMasterProfile.java new file mode 100644 index 00000000000..23f1b81dd61 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceMasterProfile.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.compute; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Profile for the container service master. + */ +public class ContainerServiceMasterProfile { + /** + * Number of masters (VMs) in the container service cluster. Allowed values + * are 1, 3, and 5. The default value is 1. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * DNS prefix to be used to create the FQDN for master. + */ + @JsonProperty(value = "dnsPrefix", required = true) + private String dnsPrefix; + + /** + * FDQN for the master. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the count value. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the dnsPrefix value. + * + * @return the dnsPrefix value + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix value. + * + * @param dnsPrefix the dnsPrefix value to set + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the fqdn value. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorProfile.java new file mode 100644 index 00000000000..60b0548b243 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorProfile.java @@ -0,0 +1,45 @@ +/** + * 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; + +/** + * Profile for the container service orchestrator. + */ +public class ContainerServiceOrchestratorProfile { + /** + * The orchestrator to use to manage container service cluster resources. + * Valid values are Swarm, DCOS, and Custom. Possible values include: + * 'Swarm', 'DCOS', 'Custom', 'Kubernetes'. + */ + @JsonProperty(value = "orchestratorType", required = true) + private ContainerServiceOrchestratorTypes orchestratorType; + + /** + * Get the orchestratorType value. + * + * @return the orchestratorType value + */ + public ContainerServiceOrchestratorTypes orchestratorType() { + return this.orchestratorType; + } + + /** + * Set the orchestratorType value. + * + * @param orchestratorType the orchestratorType value to set + * @return the ContainerServiceOrchestratorProfile object itself. + */ + public ContainerServiceOrchestratorProfile withOrchestratorType(ContainerServiceOrchestratorTypes orchestratorType) { + this.orchestratorType = orchestratorType; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorTypes.java new file mode 100644 index 00000000000..e198da419d0 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceOrchestratorTypes.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 ContainerServiceOrchestratorTypes. + */ +public enum ContainerServiceOrchestratorTypes { + /** Enum value Swarm. */ + SWARM("Swarm"), + + /** Enum value DCOS. */ + DCOS("DCOS"), + + /** Enum value Custom. */ + CUSTOM("Custom"), + + /** Enum value Kubernetes. */ + KUBERNETES("Kubernetes"); + + /** The actual serialized value for a ContainerServiceOrchestratorTypes instance. */ + private String value; + + ContainerServiceOrchestratorTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContainerServiceOrchestratorTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ContainerServiceOrchestratorTypes object, or null if unable to parse. + */ + @JsonCreator + public static ContainerServiceOrchestratorTypes fromString(String value) { + ContainerServiceOrchestratorTypes[] items = ContainerServiceOrchestratorTypes.values(); + for (ContainerServiceOrchestratorTypes 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/ContainerServiceServicePrincipalProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceServicePrincipalProfile.java new file mode 100644 index 00000000000..42b61092668 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceServicePrincipalProfile.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 com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + */ +public class ContainerServiceServicePrincipalProfile { + /** + * The ID for the service principal. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /** + * The secret password associated with the service principal. + */ + @JsonProperty(value = "secret", required = true) + private String secret; + + /** + * Get the clientId value. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId value. + * + * @param clientId the clientId value to set + * @return the ContainerServiceServicePrincipalProfile object itself. + */ + public ContainerServiceServicePrincipalProfile withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret value. + * + * @return the secret value + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret value. + * + * @param secret the secret value to set + * @return the ContainerServiceServicePrincipalProfile object itself. + */ + public ContainerServiceServicePrincipalProfile withSecret(String secret) { + this.secret = secret; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshConfiguration.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshConfiguration.java new file mode 100644 index 00000000000..d566d7b4c3c --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshConfiguration.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; + +/** + * SSH configuration for Linux-based VMs running on Azure. + */ +public class ContainerServiceSshConfiguration { + /** + * the list of SSH public keys used to authenticate with Linux-based VMs. + */ + @JsonProperty(value = "publicKeys", required = true) + private List publicKeys; + + /** + * Get the publicKeys value. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys value. + * + * @param publicKeys the publicKeys value to set + * @return the ContainerServiceSshConfiguration object itself. + */ + public ContainerServiceSshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshPublicKey.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshPublicKey.java new file mode 100644 index 00000000000..a7b769a92ee --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceSshPublicKey.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; + +/** + * Contains information about SSH certificate public key data. + */ +public class ContainerServiceSshPublicKey { + /** + * Certificate public key used to authenticate with VMs through SSH. The + * certificate must be in PEM format with or without headers. + */ + @JsonProperty(value = "keyData", required = true) + private String keyData; + + /** + * Get the keyData value. + * + * @return the keyData value + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData value. + * + * @param keyData the keyData value to set + * @return the ContainerServiceSshPublicKey object itself. + */ + public ContainerServiceSshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMDiagnostics.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMDiagnostics.java new file mode 100644 index 00000000000..c035c63fe9f --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMDiagnostics.java @@ -0,0 +1,58 @@ +/** + * 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; + +/** + * Profile for diagnostics on the container service VMs. + */ +public class ContainerServiceVMDiagnostics { + /** + * Whether the VM diagnostic agent is provisioned on the VM. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * The URI of the storage account where diagnostics are stored. + */ + @JsonProperty(value = "storageUri", access = JsonProperty.Access.WRITE_ONLY) + private String storageUri; + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the ContainerServiceVMDiagnostics object itself. + */ + public ContainerServiceVMDiagnostics withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri value. + * + * @return the storageUri value + */ + public String storageUri() { + return this.storageUri; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMSizeTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMSizeTypes.java new file mode 100644 index 00000000000..c64b4ad93e1 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceVMSizeTypes.java @@ -0,0 +1,176 @@ +/** + * 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 ContainerServiceVMSizeTypes. + */ +public final class ContainerServiceVMSizeTypes extends ExpandableStringEnum { + /** Static value Standard_A0 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A0 = fromString("Standard_A0"); + + /** Static value Standard_A1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A1 = fromString("Standard_A1"); + + /** Static value Standard_A2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A2 = fromString("Standard_A2"); + + /** Static value Standard_A3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A3 = fromString("Standard_A3"); + + /** Static value Standard_A4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A4 = fromString("Standard_A4"); + + /** Static value Standard_A5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A5 = fromString("Standard_A5"); + + /** Static value Standard_A6 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A6 = fromString("Standard_A6"); + + /** Static value Standard_A7 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A7 = fromString("Standard_A7"); + + /** Static value Standard_A8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A8 = fromString("Standard_A8"); + + /** Static value Standard_A9 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A9 = fromString("Standard_A9"); + + /** Static value Standard_A10 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A10 = fromString("Standard_A10"); + + /** Static value Standard_A11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A11 = fromString("Standard_A11"); + + /** Static value Standard_D1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D1 = fromString("Standard_D1"); + + /** Static value Standard_D2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2 = fromString("Standard_D2"); + + /** Static value Standard_D3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D3 = fromString("Standard_D3"); + + /** Static value Standard_D4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4 = fromString("Standard_D4"); + + /** Static value Standard_D11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D11 = fromString("Standard_D11"); + + /** Static value Standard_D12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D12 = fromString("Standard_D12"); + + /** Static value Standard_D13 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D13 = fromString("Standard_D13"); + + /** Static value Standard_D14 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D14 = fromString("Standard_D14"); + + /** Static value Standard_D1_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); + + /** Static value Standard_D2_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); + + /** Static value Standard_D3_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); + + /** Static value Standard_D4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); + + /** Static value Standard_D5_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); + + /** Static value Standard_D11_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_D13_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_D14_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D14_V2 = fromString("Standard_D14_v2"); + + /** Static value Standard_G1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G1 = fromString("Standard_G1"); + + /** Static value Standard_G2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G2 = fromString("Standard_G2"); + + /** Static value Standard_G3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G3 = fromString("Standard_G3"); + + /** Static value Standard_G4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G4 = fromString("Standard_G4"); + + /** Static value Standard_G5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G5 = fromString("Standard_G5"); + + /** Static value Standard_DS1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS1 = fromString("Standard_DS1"); + + /** Static value Standard_DS2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS2 = fromString("Standard_DS2"); + + /** Static value Standard_DS3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS3 = fromString("Standard_DS3"); + + /** Static value Standard_DS4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS4 = fromString("Standard_DS4"); + + /** Static value Standard_DS11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS11 = fromString("Standard_DS11"); + + /** Static value Standard_DS12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS12 = fromString("Standard_DS12"); + + /** Static value Standard_DS13 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13 = fromString("Standard_DS13"); + + /** Static value Standard_DS14 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14 = fromString("Standard_DS14"); + + /** Static value Standard_GS1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS1 = fromString("Standard_GS1"); + + /** Static value Standard_GS2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS2 = fromString("Standard_GS2"); + + /** Static value Standard_GS3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS3 = fromString("Standard_GS3"); + + /** Static value Standard_GS4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS4 = fromString("Standard_GS4"); + + /** Static value Standard_GS5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS5 = fromString("Standard_GS5"); + + /** + * Creates or finds a ContainerServiceVMSizeTypes from its string representation. + * @param name a name to look for + * @return the corresponding ContainerServiceVMSizeTypes + */ + @JsonCreator + public static ContainerServiceVMSizeTypes fromString(String name) { + return fromString(name, ContainerServiceVMSizeTypes.class); + } + + /** + * @return known ContainerServiceVMSizeTypes values + */ + public static Collection values() { + return values(ContainerServiceVMSizeTypes.class); + } +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceWindowsProfile.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceWindowsProfile.java new file mode 100644 index 00000000000..70adffeb299 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ContainerServiceWindowsProfile.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; + +/** + * Profile for Windows VMs in the container service cluster. + */ +public class ContainerServiceWindowsProfile { + /** + * The administrator username to use for Windows VMs. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /** + * The administrator password to use for Windows VMs. + */ + @JsonProperty(value = "adminPassword", required = true) + private String adminPassword; + + /** + * Get the adminUsername value. + * + * @return the adminUsername value + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername value. + * + * @param adminUsername the adminUsername value to set + * @return the ContainerServiceWindowsProfile object itself. + */ + public ContainerServiceWindowsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword value. + * + * @return the adminPassword value + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword value. + * + * @param adminPassword the adminPassword value to set + * @return the ContainerServiceWindowsProfile object itself. + */ + public ContainerServiceWindowsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + 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 146a70f1873..3a4a97be686 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 @@ -16,7 +16,8 @@ public class CreationData { /** * This enumerates the possible sources of a disk's creation. Possible - * values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy'. + * values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', + * 'Restore'. */ @JsonProperty(value = "createOption", required = true) private DiskCreateOption createOption; @@ -36,8 +37,8 @@ public class CreationData { private ImageDiskReference imageReference; /** - * If creationOption is Import, this is the URI of a blob to be imported - * into a managed disk. + * If createOption is Import, this is the URI of a blob to be imported into + * a managed disk. */ @JsonProperty(value = "sourceUri") private String sourceUri; 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 66cb552f26d..f937855d07f 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 @@ -53,6 +53,13 @@ public class DataDisk { @JsonProperty(value = "caching") private CachingTypes caching; + /** + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + /** * Specifies how the virtual machine should be created.<br><br> * Possible values are:<br><br> **Attach** \u2013 This value is @@ -181,6 +188,26 @@ public DataDisk withCaching(CachingTypes caching) { return this; } + /** + * Get the writeAcceleratorEnabled value. + * + * @return the writeAcceleratorEnabled value + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled value. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set + * @return the DataDisk object itself. + */ + public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + /** * Get the createOption value. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOption.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOption.java index 903fd7cbca9..98c18c3d144 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOption.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOption.java @@ -8,55 +8,46 @@ package com.microsoft.azure.management.compute; +import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for DiskCreateOption. */ -public enum DiskCreateOption { - /** Enum value Empty. */ - EMPTY("Empty"), +public final class DiskCreateOption extends ExpandableStringEnum { + /** Static value Empty for DiskCreateOption. */ + public static final DiskCreateOption EMPTY = fromString("Empty"); - /** Enum value Attach. */ - ATTACH("Attach"), + /** Static value Attach for DiskCreateOption. */ + public static final DiskCreateOption ATTACH = fromString("Attach"); - /** Enum value FromImage. */ - FROM_IMAGE("FromImage"), + /** Static value FromImage for DiskCreateOption. */ + public static final DiskCreateOption FROM_IMAGE = fromString("FromImage"); - /** Enum value Import. */ - IMPORT("Import"), + /** Static value Import for DiskCreateOption. */ + public static final DiskCreateOption IMPORT = fromString("Import"); - /** Enum value Copy. */ - COPY("Copy"); + /** Static value Copy for DiskCreateOption. */ + public static final DiskCreateOption COPY = fromString("Copy"); - /** The actual serialized value for a DiskCreateOption instance. */ - private String value; - - DiskCreateOption(String value) { - this.value = value; - } + /** Static value Restore for DiskCreateOption. */ + public static final DiskCreateOption RESTORE = fromString("Restore"); /** - * Parses a serialized value to a DiskCreateOption instance. - * - * @param value the serialized value to parse. - * @return the parsed DiskCreateOption object, or null if unable to parse. + * Creates or finds a DiskCreateOption from its string representation. + * @param name a name to look for + * @return the corresponding DiskCreateOption */ @JsonCreator - public static DiskCreateOption fromString(String value) { - DiskCreateOption[] items = DiskCreateOption.values(); - for (DiskCreateOption item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiskCreateOption fromString(String name) { + return fromString(name, DiskCreateOption.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * @return known DiskCreateOption values + */ + public static Collection values() { + return values(DiskCreateOption.class); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOptionTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOptionTypes.java index b8c17affbbe..66781dc00fe 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOptionTypes.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/DiskCreateOptionTypes.java @@ -8,49 +8,37 @@ package com.microsoft.azure.management.compute; +import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for DiskCreateOptionTypes. */ -public enum DiskCreateOptionTypes { - /** Enum value FromImage. */ - FROM_IMAGE("FromImage"), +public final class DiskCreateOptionTypes extends ExpandableStringEnum { + /** Static value FromImage for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes FROM_IMAGE = fromString("FromImage"); - /** Enum value Empty. */ - EMPTY("Empty"), + /** Static value Empty for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); - /** Enum value Attach. */ - ATTACH("Attach"); - - /** The actual serialized value for a DiskCreateOptionTypes instance. */ - private String value; - - DiskCreateOptionTypes(String value) { - this.value = value; - } + /** Static value Attach for DiskCreateOptionTypes. */ + public static final DiskCreateOptionTypes ATTACH = fromString("Attach"); /** - * Parses a serialized value to a DiskCreateOptionTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed DiskCreateOptionTypes object, or null if unable to parse. + * Creates or finds a DiskCreateOptionTypes from its string representation. + * @param name a name to look for + * @return the corresponding DiskCreateOptionTypes */ @JsonCreator - public static DiskCreateOptionTypes fromString(String value) { - DiskCreateOptionTypes[] items = DiskCreateOptionTypes.values(); - for (DiskCreateOptionTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiskCreateOptionTypes fromString(String name) { + return fromString(name, DiskCreateOptionTypes.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * @return known DiskCreateOptionTypes values + */ + public static Collection values() { + return values(DiskCreateOptionTypes.class); } } 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 39b94bcaf85..b42552ed482 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 @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. + * The disks sku name. Can be Standard_LRS or Premium_LRS. */ public class DiskSku { /** 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 88c92002d66..70ea72443eb 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 @@ -31,26 +31,48 @@ public class HardwareProfile { * '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_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_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_F1', 'Standard_F2', - * 'Standard_F4', 'Standard_F8', 'Standard_F16', 'Standard_F1s', - * 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', - * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - * 'Standard_G5', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - * 'Standard_GS4', 'Standard_GS5', 'Standard_H8', 'Standard_H16', - * 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', 'Standard_H16mr', - * 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', 'Standard_L32s', + * '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_NV6', 'Standard_NV12', 'Standard_NV24'. + * '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'. */ @JsonProperty(value = "vmSize") private VirtualMachineSizeTypes vmSize; 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 616a6d8e130..ba07ddb38d0 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 @@ -33,6 +33,14 @@ public class ImageStorageProfile { @JsonProperty(value = "dataDisks") private List dataDisks; + /** + * 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). + */ + @JsonProperty(value = "zoneResilient") + private Boolean zoneResilient; + /** * Get the osDisk value. * @@ -73,4 +81,24 @@ public ImageStorageProfile withDataDisks(List dataDisks) { return this; } + /** + * Get the zoneResilient value. + * + * @return the zoneResilient value + */ + public Boolean zoneResilient() { + return this.zoneResilient; + } + + /** + * Set the zoneResilient value. + * + * @param zoneResilient the zoneResilient value to set + * @return the ImageStorageProfile object itself. + */ + public ImageStorageProfile withZoneResilient(Boolean zoneResilient) { + this.zoneResilient = zoneResilient; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/IntervalInMins.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/IntervalInMins.java new file mode 100644 index 00000000000..80bfad9437d --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/IntervalInMins.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 IntervalInMins. + */ +public enum IntervalInMins { + /** Enum value ThreeMins. */ + THREE_MINS("ThreeMins"), + + /** Enum value FiveMins. */ + FIVE_MINS("FiveMins"), + + /** Enum value ThirtyMins. */ + THIRTY_MINS("ThirtyMins"), + + /** Enum value SixtyMins. */ + SIXTY_MINS("SixtyMins"); + + /** The actual serialized value for a IntervalInMins instance. */ + private String value; + + IntervalInMins(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IntervalInMins instance. + * + * @param value the serialized value to parse. + * @return the parsed IntervalInMins object, or null if unable to parse. + */ + @JsonCreator + public static IntervalInMins fromString(String value) { + IntervalInMins[] items = IntervalInMins.values(); + for (IntervalInMins 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/LogAnalyticsInputBase.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java new file mode 100644 index 00000000000..ea7bb1f06a3 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsInputBase.java @@ -0,0 +1,175 @@ +/** + * 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; + +/** + * Api input base class for LogAnalytics Api. + */ +public class LogAnalyticsInputBase { + /** + * SAS Uri of the logging blob container to which LogAnalytics Api writes + * output logs to. + */ + @JsonProperty(value = "blobContainerSasUri", required = true) + private String blobContainerSasUri; + + /** + * From time of the query. + */ + @JsonProperty(value = "fromTime", required = true) + private DateTime fromTime; + + /** + * To time of the query. + */ + @JsonProperty(value = "toTime", required = true) + private DateTime toTime; + + /** + * Group query result by Throttle Policy applied. + */ + @JsonProperty(value = "groupByThrottlePolicy") + private Boolean groupByThrottlePolicy; + + /** + * Group query result by by Operation Name. + */ + @JsonProperty(value = "groupByOperationName") + private Boolean groupByOperationName; + + /** + * Group query result by Resource Name. + */ + @JsonProperty(value = "groupByResourceName") + private Boolean groupByResourceName; + + /** + * Get the blobContainerSasUri value. + * + * @return the blobContainerSasUri value + */ + public String blobContainerSasUri() { + return this.blobContainerSasUri; + } + + /** + * Set the blobContainerSasUri value. + * + * @param blobContainerSasUri the blobContainerSasUri value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withBlobContainerSasUri(String blobContainerSasUri) { + this.blobContainerSasUri = blobContainerSasUri; + return this; + } + + /** + * Get the fromTime value. + * + * @return the fromTime value + */ + public DateTime fromTime() { + return this.fromTime; + } + + /** + * Set the fromTime value. + * + * @param fromTime the fromTime value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withFromTime(DateTime fromTime) { + this.fromTime = fromTime; + return this; + } + + /** + * Get the toTime value. + * + * @return the toTime value + */ + public DateTime toTime() { + return this.toTime; + } + + /** + * Set the toTime value. + * + * @param toTime the toTime value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withToTime(DateTime toTime) { + this.toTime = toTime; + return this; + } + + /** + * Get the groupByThrottlePolicy value. + * + * @return the groupByThrottlePolicy value + */ + public Boolean groupByThrottlePolicy() { + return this.groupByThrottlePolicy; + } + + /** + * Set the groupByThrottlePolicy value. + * + * @param groupByThrottlePolicy the groupByThrottlePolicy value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByThrottlePolicy(Boolean groupByThrottlePolicy) { + this.groupByThrottlePolicy = groupByThrottlePolicy; + return this; + } + + /** + * Get the groupByOperationName value. + * + * @return the groupByOperationName value + */ + public Boolean groupByOperationName() { + return this.groupByOperationName; + } + + /** + * Set the groupByOperationName value. + * + * @param groupByOperationName the groupByOperationName value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByOperationName(Boolean groupByOperationName) { + this.groupByOperationName = groupByOperationName; + return this; + } + + /** + * Get the groupByResourceName value. + * + * @return the groupByResourceName value + */ + public Boolean groupByResourceName() { + return this.groupByResourceName; + } + + /** + * Set the groupByResourceName value. + * + * @param groupByResourceName the groupByResourceName value to set + * @return the LogAnalyticsInputBase object itself. + */ + public LogAnalyticsInputBase withGroupByResourceName(Boolean groupByResourceName) { + this.groupByResourceName = groupByResourceName; + return this; + } + +} 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 new file mode 100644 index 00000000000..e7cc3767cd5 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/LogAnalyticsOutput.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; + +/** + * LogAnalytics output properties. + */ +public class LogAnalyticsOutput { + /** + * Output file Uri path to blob container. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private String output; + + /** + * Get the output value. + * + * @return the output value + */ + public String output() { + return this.output; + } + +} 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 8e598af97a3..0f6da66a142 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 @@ -65,6 +65,13 @@ public class OSDisk { @JsonProperty(value = "caching") private CachingTypes caching; + /** + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + /** * Specifies how the virtual machine should be created.<br><br> * Possible values are:<br><br> **Attach** \u2013 This value is @@ -213,6 +220,26 @@ public OSDisk withCaching(CachingTypes caching) { return this; } + /** + * Get the writeAcceleratorEnabled value. + * + * @return the writeAcceleratorEnabled value + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled value. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set + * @return the OSDisk object itself. + */ + public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + /** * Get the createOption value. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceIdentityType.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceIdentityType.java index 523377f9c55..071988f8454 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceIdentityType.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceIdentityType.java @@ -56,4 +56,4 @@ public static ResourceIdentityType fromString(String value) { public String toString() { return this.value; } -} \ No newline at end of file +} 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 new file mode 100644 index 00000000000..3e80e2e5d9d --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionInfo.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; + +/** + * The ResourceSkuRestrictionInfo model. + */ +public class ResourceSkuRestrictionInfo { + /** + * Locations where the SKU is restricted. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * List of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /** + * Get the locations value. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the zones value. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + +} 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 ade5567cff4..428fcbdf411 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 @@ -16,7 +16,7 @@ */ public class ResourceSkuRestrictions { /** - * The type of restrictions. Possible values include: 'Location'. + * The type of restrictions. Possible values include: 'Location', 'Zone'. */ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private ResourceSkuRestrictionsType type; @@ -28,6 +28,12 @@ public class ResourceSkuRestrictions { @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) private List values; + /** + * The information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionInfo restrictionInfo; + /** * The reason for restriction. Possible values include: 'QuotaId', * 'NotAvailableForSubscription'. @@ -53,6 +59,15 @@ public List values() { return this.values; } + /** + * Get the restrictionInfo value. + * + * @return the restrictionInfo value + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + /** * Get the reasonCode value. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionsType.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionsType.java index d6cc5870905..60a3f131f0f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionsType.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/ResourceSkuRestrictionsType.java @@ -17,6 +17,7 @@ public enum ResourceSkuRestrictionsType { /** Enum value Location. */ LOCATION("Location"), + /** Enum value Zone. */ ZONE("Zone"); 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 new file mode 100644 index 00000000000..93f0786a195 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotSku.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.JsonProperty; + +/** + * The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + */ +public class SnapshotSku { + /** + * The sku name. Possible values include: 'Standard_LRS', 'Premium_LRS', + * 'Standard_ZRS'. + */ + @JsonProperty(value = "name") + private SnapshotStorageAccountTypes name; + + /** + * The sku tier. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * Get the name value. + * + * @return the name value + */ + public SnapshotStorageAccountTypes name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SnapshotSku object itself. + */ + public SnapshotSku withName(SnapshotStorageAccountTypes name) { + this.name = name; + return this; + } + + /** + * Get the tier value. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotStorageAccountTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotStorageAccountTypes.java new file mode 100644 index 00000000000..a71f94e2763 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/SnapshotStorageAccountTypes.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.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SnapshotStorageAccountTypes. + */ +public final class SnapshotStorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Standard_ZRS for SnapshotStorageAccountTypes. */ + public static final SnapshotStorageAccountTypes STANDARD_ZRS = fromString("Standard_ZRS"); + + /** + * Creates or finds a SnapshotStorageAccountTypes from its string representation. + * @param name a name to look for + * @return the corresponding SnapshotStorageAccountTypes + */ + @JsonCreator + public static SnapshotStorageAccountTypes fromString(String name) { + return fromString(name, SnapshotStorageAccountTypes.class); + } + + /** + * @return known SnapshotStorageAccountTypes values + */ + public static Collection values() { + return values(SnapshotStorageAccountTypes.class); + } +} 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 5bb870970bd..0f30ca9c570 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 @@ -8,52 +8,34 @@ package com.microsoft.azure.management.compute; +import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.microsoft.rest.ExpandableStringEnum; /** * Defines values for StorageAccountTypes. */ -public enum StorageAccountTypes { - /** Enum value Standard_LRS. */ - STANDARD_LRS("Standard_LRS"), +public final class StorageAccountTypes extends ExpandableStringEnum { + /** Static value Standard_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); - /** Enum value Premium_LRS. */ - PREMIUM_LRS("Premium_LRS"), - - /** Enum value StandardSSD_LRS. */ - STANDARD_SSD_LRS("StandardSSD_LRS"), - - /** Enum value Standard_ZRS. */ - STANDARD_ZRS("Standard_ZRS"); - - /** The actual serialized value for a StorageAccountTypes instance. */ - private String value; - - StorageAccountTypes(String value) { - this.value = value; - } + /** Static value Premium_LRS for StorageAccountTypes. */ + public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); /** - * Parses a serialized value to a StorageAccountTypes instance. - * - * @param value the serialized value to parse. - * @return the parsed StorageAccountTypes object, or null if unable to parse. + * Creates or finds a StorageAccountTypes from its string representation. + * @param name a name to look for + * @return the corresponding StorageAccountTypes */ @JsonCreator - public static StorageAccountTypes fromString(String value) { - StorageAccountTypes[] items = StorageAccountTypes.values(); - for (StorageAccountTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static StorageAccountTypes fromString(String name) { + return fromString(name, StorageAccountTypes.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * @return known StorageAccountTypes values + */ + public static Collection values() { + return values(StorageAccountTypes.class); } -} \ No newline at end of file +} 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 8d734f6633a..46608449473 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 @@ -105,4 +105,5 @@ public VirtualMachineIdentity withIdentityIds(List identityIds) { this.identityIds = identityIds; return this; } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePriorityTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePriorityTypes.java new file mode 100644 index 00000000000..5650be30127 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePriorityTypes.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 VirtualMachinePriorityTypes. + */ +public final class VirtualMachinePriorityTypes extends ExpandableStringEnum { + /** Static value Regular for VirtualMachinePriorityTypes. */ + public static final VirtualMachinePriorityTypes REGULAR = fromString("Regular"); + + /** Static value Low for VirtualMachinePriorityTypes. */ + public static final VirtualMachinePriorityTypes LOW = fromString("Low"); + + /** + * Creates or finds a VirtualMachinePriorityTypes from its string representation. + * @param name a name to look for + * @return the corresponding VirtualMachinePriorityTypes + */ + @JsonCreator + public static VirtualMachinePriorityTypes fromString(String name) { + return fromString(name, VirtualMachinePriorityTypes.class); + } + + /** + * @return known VirtualMachinePriorityTypes values + */ + public static Collection values() { + return values(VirtualMachinePriorityTypes.class); + } +} 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 77302984fb8..a4d5b44bb52 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 @@ -38,6 +38,13 @@ public class VirtualMachineScaleSetDataDisk { @JsonProperty(value = "caching") private CachingTypes caching; + /** + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + /** * The create option. Possible values include: 'FromImage', 'Empty', * 'Attach'. @@ -119,6 +126,26 @@ public VirtualMachineScaleSetDataDisk withCaching(CachingTypes caching) { return this; } + /** + * Get the writeAcceleratorEnabled value. + * + * @return the writeAcceleratorEnabled value + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled value. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + /** * Get the createOption value. * 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 73b7799774c..1c058e7416b 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 @@ -105,4 +105,5 @@ public VirtualMachineScaleSetIdentity withIdentityIds(List identityIds) this.identityIds = identityIds; 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 5f3497e05b4..34b6840c803 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 @@ -31,6 +31,13 @@ public class VirtualMachineScaleSetOSDisk { @JsonProperty(value = "caching") private CachingTypes caching; + /** + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + /** * Specifies how the virtual machines in the scale set should be * created.<br><br> The only allowed value is: **FromImage** @@ -113,6 +120,26 @@ public VirtualMachineScaleSetOSDisk withCaching(CachingTypes caching) { return this; } + /** + * Get the writeAcceleratorEnabled value. + * + * @return the writeAcceleratorEnabled value + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled value. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + /** * Get the createOption value. * 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 b0cad4662c1..acbd5463e0b 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 @@ -23,6 +23,13 @@ public class VirtualMachineScaleSetUpdateOSDisk { @JsonProperty(value = "caching") private CachingTypes caching; + /** + * Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + /** * The Source User Image VirtualHardDisk. This VirtualHardDisk will be * copied before using it to attach to the Virtual Machine. If SourceImage @@ -63,6 +70,26 @@ public VirtualMachineScaleSetUpdateOSDisk withCaching(CachingTypes caching) { return this; } + /** + * Get the writeAcceleratorEnabled value. + * + * @return the writeAcceleratorEnabled value + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled value. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set + * @return the VirtualMachineScaleSetUpdateOSDisk object itself. + */ + public VirtualMachineScaleSetUpdateOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + /** * Get the image value. * 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 51b0c4f5371..eb0b85307dd 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 @@ -63,6 +63,14 @@ public class VirtualMachineScaleSetVMProfile { @JsonProperty(value = "licenseType") private String licenseType; + /** + * 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'. + */ + @JsonProperty(value = "priority") + private VirtualMachinePriorityTypes priority; + /** * Get the osProfile value. * @@ -183,4 +191,24 @@ public VirtualMachineScaleSetVMProfile withLicenseType(String licenseType) { return this; } + /** + * Get the priority value. + * + * @return the priority value + */ + public VirtualMachinePriorityTypes priority() { + return this.priority; + } + + /** + * Set the priority value. + * + * @param priority the priority value to set + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withPriority(VirtualMachinePriorityTypes priority) { + this.priority = priority; + return this; + } + } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSizeTypes.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSizeTypes.java index 25274d9bc92..d1e1147a39f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSizeTypes.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSizeTypes.java @@ -88,6 +88,24 @@ public final class VirtualMachineSizeTypes extends ExpandableStringEnum agentPoolProfiles; + + /** + * Properties of Windows VMs. + */ + @JsonProperty(value = "properties.windowsProfile") + private ContainerServiceWindowsProfile windowsProfile; + + /** + * Properties of Linux VMs. + */ + @JsonProperty(value = "properties.linuxProfile", required = true) + private ContainerServiceLinuxProfile linuxProfile; + + /** + * Properties of the diagnostic agent. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private ContainerServiceDiagnosticsProfile diagnosticsProfile; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the orchestratorProfile value. + * + * @return the orchestratorProfile value + */ + public ContainerServiceOrchestratorProfile orchestratorProfile() { + return this.orchestratorProfile; + } + + /** + * Set the orchestratorProfile value. + * + * @param orchestratorProfile the orchestratorProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile) { + this.orchestratorProfile = orchestratorProfile; + return this; + } + + /** + * Get the customProfile value. + * + * @return the customProfile value + */ + public ContainerServiceCustomProfile customProfile() { + return this.customProfile; + } + + /** + * Set the customProfile value. + * + * @param customProfile the customProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withCustomProfile(ContainerServiceCustomProfile customProfile) { + this.customProfile = customProfile; + return this; + } + + /** + * Get the servicePrincipalProfile value. + * + * @return the servicePrincipalProfile value + */ + public ContainerServiceServicePrincipalProfile servicePrincipalProfile() { + return this.servicePrincipalProfile; + } + + /** + * Set the servicePrincipalProfile value. + * + * @param servicePrincipalProfile the servicePrincipalProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withServicePrincipalProfile(ContainerServiceServicePrincipalProfile servicePrincipalProfile) { + this.servicePrincipalProfile = servicePrincipalProfile; + return this; + } + + /** + * Get the masterProfile value. + * + * @return the masterProfile value + */ + public ContainerServiceMasterProfile masterProfile() { + return this.masterProfile; + } + + /** + * Set the masterProfile value. + * + * @param masterProfile the masterProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withMasterProfile(ContainerServiceMasterProfile masterProfile) { + this.masterProfile = masterProfile; + return this; + } + + /** + * Get the agentPoolProfiles value. + * + * @return the agentPoolProfiles value + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles value. + * + * @param agentPoolProfiles the agentPoolProfiles value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withAgentPoolProfiles(List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Get the windowsProfile value. + * + * @return the windowsProfile value + */ + public ContainerServiceWindowsProfile windowsProfile() { + return this.windowsProfile; + } + + /** + * Set the windowsProfile value. + * + * @param windowsProfile the windowsProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withWindowsProfile(ContainerServiceWindowsProfile windowsProfile) { + this.windowsProfile = windowsProfile; + return this; + } + + /** + * Get the linuxProfile value. + * + * @return the linuxProfile value + */ + public ContainerServiceLinuxProfile linuxProfile() { + return this.linuxProfile; + } + + /** + * Set the linuxProfile value. + * + * @param linuxProfile the linuxProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + this.linuxProfile = linuxProfile; + return this; + } + + /** + * Get the diagnosticsProfile value. + * + * @return the diagnosticsProfile value + */ + public ContainerServiceDiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile value. + * + * @param diagnosticsProfile the diagnosticsProfile value to set + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + +} diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ContainerServicesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ContainerServicesInner.java new file mode 100644 index 00000000000..4f52a627167 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ContainerServicesInner.java @@ -0,0 +1,988 @@ +/** + * 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 ContainerServices. + */ +public class ContainerServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerServicesService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of ContainerServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerServicesInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(ContainerServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServices to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.ContainerServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices") + 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.ContainerServices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("containerServiceName") String containerServiceName, @Path("subscriptionId") String subscriptionId, @Body ContainerServiceInner 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.ContainerServices beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("containerServiceName") String containerServiceName, @Path("subscriptionId") String subscriptionId, @Body ContainerServiceInner 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.ContainerServices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("containerServiceName") String containerServiceName, @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.ContainerServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("containerServiceName") String containerServiceName, @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.ContainerServices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("containerServiceName") String containerServiceName, @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.ContainerServices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.ContainerServices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.ContainerServices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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(); + } + }; + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerServiceInner> 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)); + } + }); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerServiceInner> 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 = "2017-01-31"; + 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); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 ContainerServiceInner object if successful. + */ + public ContainerServiceInner createOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 containerServiceName, ContainerServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters), serviceCallback); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).map(new Func1, ContainerServiceInner>() { + @Override + public ContainerServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerServiceName == null) { + throw new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; + Observable> observable = service.createOrUpdate(resourceGroupName, containerServiceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 ContainerServiceInner object if successful. + */ + public ContainerServiceInner beginCreateOrUpdate(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 containerServiceName, ContainerServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters), serviceCallback); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).map(new Func1, ContainerServiceInner>() { + @Override + public ContainerServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a container service. + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerServiceName == null) { + throw new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; + return service.beginCreateOrUpdate(resourceGroupName, containerServiceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container service. + * Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 ContainerServiceInner object if successful. + */ + public ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container service. + * Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 getByResourceGroupAsync(String resourceGroupName, String containerServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerServiceName), serviceCallback); + } + + /** + * Gets the properties of the specified container service. + * Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerServiceName).map(new Func1, ContainerServiceInner>() { + @Override + public ContainerServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container service. + * Gets the properties of the specified container service in the specified subscription and resource group. The operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerServiceName == null) { + throw new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; + return service.getByResourceGroup(resourceGroupName, containerServiceName, this.client.subscriptionId(), 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); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 + */ + public void delete(String resourceGroupName, String containerServiceName) { + deleteWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().last().body(); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 deleteAsync(String resourceGroupName, String containerServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerServiceName), serviceCallback); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String containerServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerServiceName == null) { + throw new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; + Observable> observable = service.delete(resourceGroupName, containerServiceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 + */ + public void beginDelete(String resourceGroupName, String containerServiceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().single().body(); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 beginDeleteAsync(String resourceGroupName, String containerServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, containerServiceName), serviceCallback); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String containerServiceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, containerServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified container service. + * Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with the container service are part of the same resource group and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String containerServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (containerServiceName == null) { + throw new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; + return service.beginDelete(resourceGroupName, containerServiceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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(); + } + }; + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerServiceInner> 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)); + } + }); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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 = "2017-01-31"; + 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); + 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); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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(); + } + }; + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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)); + } + }); + } + + /** + * Gets a list of container services in the specified subscription. + * Gets a list of container services in the specified subscription. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerServiceInner> 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); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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(); + } + }; + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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<ContainerServiceInner> 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)); + } + }); + } + + /** + * Gets a list of container services in the specified resource group. + * Gets a list of container services in the specified subscription and resource group. The operation returns properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerServiceInner> 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); + } + +} 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 e8d791f32d9..8b8b7ecb7cf 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 @@ -132,7 +132,7 @@ interface DisksService { * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -147,7 +147,7 @@ public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskI * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -161,7 +161,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupName, St * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -179,7 +179,7 @@ public DiskInner call(ServiceResponse response) { * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -198,7 +198,7 @@ public Observable> createOrUpdateWithServiceResponseA throw new IllegalArgumentException("Parameter disk is required and cannot be null."); } Validator.validate(disk); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, disk, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -207,7 +207,7 @@ public Observable> createOrUpdateWithServiceResponseA * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -222,7 +222,7 @@ public DiskInner beginCreateOrUpdate(String resourceGroupName, String diskName, * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -236,7 +236,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupNam * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object @@ -254,7 +254,7 @@ public DiskInner call(ServiceResponse response) { * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object @@ -273,7 +273,7 @@ public Observable> beginCreateOrUpdateWithServiceResp throw new IllegalArgumentException("Parameter disk is required and cannot be null."); } Validator.validate(disk); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, disk, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -300,7 +300,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String dis * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -347,7 +347,7 @@ public DiskInner call(ServiceResponse response) { * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -366,7 +366,7 @@ public Observable> updateWithServiceResponseAsync(Str throw new IllegalArgumentException("Parameter disk is required and cannot be null."); } Validator.validate(disk); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, disk, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -375,7 +375,7 @@ public Observable> updateWithServiceResponseAsync(Str * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -390,7 +390,7 @@ public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpda * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -404,7 +404,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, Strin * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object @@ -422,7 +422,7 @@ public DiskInner call(ServiceResponse response) { * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param disk Disk object supplied in the body of the Patch disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DiskInner object @@ -441,7 +441,7 @@ public Observable> beginUpdateWithServiceResponseAsyn throw new IllegalArgumentException("Parameter disk is required and cannot be null."); } Validator.validate(disk); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, disk, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -468,7 +468,7 @@ private ServiceResponse beginUpdateDelegate(Response re * Gets information about a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -482,7 +482,7 @@ public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { * Gets information about a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -495,7 +495,7 @@ public ServiceFuture getByResourceGroupAsync(String resourceGroupName * Gets information about a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 DiskInner object */ @@ -512,7 +512,7 @@ public DiskInner call(ServiceResponse response) { * Gets information about a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 DiskInner object */ @@ -526,7 +526,7 @@ public Observable> getByResourceGroupWithServiceRespo if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -552,7 +552,7 @@ private ServiceResponse getByResourceGroupDelegate(Response deleteAsync(String resourceGr * Deletes a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 for the request */ @@ -596,7 +596,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServi if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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()); } @@ -619,7 +619,7 @@ public Observable> deleteWithServi * Deletes a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -633,7 +633,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * Deletes a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -646,7 +646,7 @@ public ServiceFuture beginDeleteAsync(String resou * Deletes a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 */ @@ -663,7 +663,7 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWith if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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>>() { @Override @@ -792,7 +792,7 @@ public Observable>> listByResourceGroupSinglePag if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -897,7 +897,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-03-30"; + final String apiVersion = "2018-04-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -923,7 +923,7 @@ private ServiceResponse> listDelegate(Response grantAccessAsync(String resourceGroupName, * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -970,7 +970,7 @@ public AccessUriInner call(ServiceResponse response) { * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -989,7 +989,7 @@ public Observable> grantAccessWithServiceRespons throw new IllegalArgumentException("Parameter grantAccessData is required and cannot be null."); } Validator.validate(grantAccessData); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.grantAccess(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, grantAccessData, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -998,7 +998,7 @@ public Observable> grantAccessWithServiceRespons * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -1013,7 +1013,7 @@ public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1027,7 +1027,7 @@ public ServiceFuture beginGrantAccessAsync(String resourceGroupN * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object @@ -1045,7 +1045,7 @@ public AccessUriInner call(ServiceResponse response) { * Grants access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get disk access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object @@ -1064,7 +1064,7 @@ public Observable> beginGrantAccessWithServiceRe throw new IllegalArgumentException("Parameter grantAccessData is required and cannot be null."); } Validator.validate(grantAccessData); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginGrantAccess(this.client.subscriptionId(), resourceGroupName, diskName, apiVersion, grantAccessData, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1091,7 +1091,7 @@ private ServiceResponse beginGrantAccessDelegate(Response revokeAccessAsync(String reso * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 for the request */ @@ -1135,7 +1135,7 @@ public OperationStatusResponseInner call(ServiceResponse> revokeAccessWit if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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()); } @@ -1158,7 +1158,7 @@ public Observable> revokeAccessWit * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -1172,7 +1172,7 @@ public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1185,7 +1185,7 @@ public ServiceFuture beginRevokeAccessAsync(String * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. - * @param diskName The name of the disk within the given subscription and 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 */ @@ -1202,7 +1202,7 @@ public OperationStatusResponseInner call(ServiceResponse> beginRevokeAcce if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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>>() { @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 new file mode 100644 index 00000000000..652a8ced8a2 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsInner.java @@ -0,0 +1,382 @@ +/** + * 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 com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 LogAnalytics. + */ +public class LogAnalyticsInner { + /** The Retrofit service to perform REST calls. */ + private LogAnalyticsService service; + /** The service client containing this operation class. */ + private ComputeManagementClientImpl client; + + /** + * Initializes an instance of LogAnalyticsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LogAnalyticsInner(Retrofit retrofit, ComputeManagementClientImpl client) { + this.service = retrofit.create(LogAnalyticsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LogAnalytics to be + * used by Retrofit to perform actually REST calls. + */ + 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); + + @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); + + @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); + + @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); + + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @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 LogAnalyticsOperationResultInner object if successful. + */ + public LogAnalyticsOperationResultInner exportRequestRateByInterval(String location, RequestRateByIntervalInputInner parameters) { + return exportRequestRateByIntervalWithServiceResponseAsync(location, parameters).toBlocking().last().body(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @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 exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportRequestRateByIntervalWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable exportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters) { + return exportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { + @Override + public LogAnalyticsOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> exportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInputInner parameters) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-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()); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @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 LogAnalyticsOperationResultInner object if successful. + */ + public LogAnalyticsOperationResultInner beginExportRequestRateByInterval(String location, RequestRateByIntervalInputInner parameters) { + return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @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 beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogAnalyticsOperationResultInner object + */ + public Observable beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInputInner parameters) { + return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { + @Override + public LogAnalyticsOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogAnalyticsOperationResultInner object + */ + public Observable> beginExportRequestRateByIntervalWithServiceResponseAsync(String location, RequestRateByIntervalInputInner parameters) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-01"; + return service.beginExportRequestRateByInterval(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExportRequestRateByIntervalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExportRequestRateByIntervalDelegate(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); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @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 LogAnalyticsOperationResultInner object if successful. + */ + public LogAnalyticsOperationResultInner exportThrottledRequests(String location, ThrottledRequestsInputInner parameters) { + return exportThrottledRequestsWithServiceResponseAsync(location, parameters).toBlocking().last().body(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @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 exportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportThrottledRequestsWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable exportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters) { + return exportThrottledRequestsWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { + @Override + public LogAnalyticsOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> exportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInputInner parameters) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-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()); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @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 LogAnalyticsOperationResultInner object if successful. + */ + public LogAnalyticsOperationResultInner beginExportThrottledRequests(String location, ThrottledRequestsInputInner parameters) { + return beginExportThrottledRequestsWithServiceResponseAsync(location, parameters).toBlocking().single().body(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @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 beginExportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExportThrottledRequestsWithServiceResponseAsync(location, parameters), serviceCallback); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogAnalyticsOperationResultInner object + */ + public Observable beginExportThrottledRequestsAsync(String location, ThrottledRequestsInputInner parameters) { + return beginExportThrottledRequestsWithServiceResponseAsync(location, parameters).map(new Func1, LogAnalyticsOperationResultInner>() { + @Override + public LogAnalyticsOperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogAnalyticsOperationResultInner object + */ + public Observable> beginExportThrottledRequestsWithServiceResponseAsync(String location, ThrottledRequestsInputInner parameters) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-01"; + return service.beginExportThrottledRequests(location, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExportThrottledRequestsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExportThrottledRequestsDelegate(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/LogAnalyticsOperationResultInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java new file mode 100644 index 00000000000..8dd8065900d --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/LogAnalyticsOperationResultInner.java @@ -0,0 +1,33 @@ +/** + * 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.LogAnalyticsOutput; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * LogAnalytics operation status response. + */ +public class LogAnalyticsOperationResultInner extends OperationStatusResponseInner { + /** + * LogAnalyticsOutput. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private LogAnalyticsOutput properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public LogAnalyticsOutput properties() { + return this.properties; + } + +} 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 new file mode 100644 index 00000000000..1d2655887c0 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RecoveryWalkResponseInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response after calling a manual recovery walk. + */ +public class RecoveryWalkResponseInner { + /** + * Whether the recovery walk was performed. + */ + @JsonProperty(value = "walkPerformed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean walkPerformed; + + /** + * The next update domain that needs to be walked. Null means walk spanning + * all update domains has been completed. + */ + @JsonProperty(value = "nextPlatformUpdateDomain", access = JsonProperty.Access.WRITE_ONLY) + private Integer nextPlatformUpdateDomain; + + /** + * Get the walkPerformed value. + * + * @return the walkPerformed value + */ + public Boolean walkPerformed() { + return this.walkPerformed; + } + + /** + * Get the nextPlatformUpdateDomain value. + * + * @return the nextPlatformUpdateDomain value + */ + public Integer nextPlatformUpdateDomain() { + return this.nextPlatformUpdateDomain; + } + +} 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/implementation/RequestRateByIntervalInputInner.java new file mode 100644 index 00000000000..8d6af4b271a --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/RequestRateByIntervalInputInner.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.implementation; + +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 { + /** + * Interval value in minutes used to create LogAnalytics call rate logs. + * Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', + * 'SixtyMins'. + */ + @JsonProperty(value = "intervalLength", required = true) + private IntervalInMins intervalLength; + + /** + * Get the intervalLength value. + * + * @return the intervalLength value + */ + public IntervalInMins intervalLength() { + return this.intervalLength; + } + + /** + * Set the intervalLength value. + * + * @param intervalLength the intervalLength value to set + * @return the RequestRateByIntervalInputInner object itself. + */ + public RequestRateByIntervalInputInner withIntervalLength(IntervalInMins intervalLength) { + this.intervalLength = intervalLength; + return this; + } + +} 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 ddc0ed006e4..851559f1d20 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 @@ -8,7 +8,7 @@ package com.microsoft.azure.management.compute.implementation; -import com.microsoft.azure.management.compute.DiskSku; +import com.microsoft.azure.management.compute.SnapshotSku; import org.joda.time.DateTime; import com.microsoft.azure.management.compute.OperatingSystemTypes; import com.microsoft.azure.management.compute.CreationData; @@ -32,7 +32,7 @@ public class SnapshotInner extends Resource { * The sku property. */ @JsonProperty(value = "sku") - private DiskSku sku; + private SnapshotSku sku; /** * The time when the disk was created. @@ -89,7 +89,7 @@ public String managedBy() { * * @return the sku value */ - public DiskSku sku() { + public SnapshotSku sku() { return this.sku; } @@ -99,7 +99,7 @@ public DiskSku sku() { * @param sku the sku value to set * @return the SnapshotInner object itself. */ - public SnapshotInner withSku(DiskSku sku) { + public SnapshotInner withSku(SnapshotSku sku) { this.sku = sku; return this; } 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 160d3e70deb..3e8637ef477 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 @@ -132,7 +132,7 @@ interface SnapshotsService { * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -147,7 +147,7 @@ public SnapshotInner createOrUpdate(String resourceGroupName, String snapshotNam * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -161,7 +161,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupName * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -179,7 +179,7 @@ public SnapshotInner call(ServiceResponse response) { * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -198,7 +198,7 @@ public Observable> createOrUpdateWithServiceRespo throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); } Validator.validate(snapshot); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, snapshot, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -207,7 +207,7 @@ public Observable> createOrUpdateWithServiceRespo * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -222,7 +222,7 @@ public SnapshotInner beginCreateOrUpdate(String resourceGroupName, String snapsh * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -236,7 +236,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String resourceGrou * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object @@ -254,7 +254,7 @@ public SnapshotInner call(ServiceResponse response) { * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Put disk operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object @@ -273,7 +273,7 @@ public Observable> beginCreateOrUpdateWithService throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); } Validator.validate(snapshot); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, snapshot, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -300,7 +300,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -347,7 +347,7 @@ public SnapshotInner call(ServiceResponse response) { * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -366,7 +366,7 @@ public Observable> updateWithServiceResponseAsync throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); } Validator.validate(snapshot); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, snapshot, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -375,7 +375,7 @@ public Observable> updateWithServiceResponseAsync * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -390,7 +390,7 @@ public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -404,7 +404,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, S * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object @@ -422,7 +422,7 @@ public SnapshotInner call(ServiceResponse response) { * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SnapshotInner object @@ -441,7 +441,7 @@ public Observable> beginUpdateWithServiceResponse throw new IllegalArgumentException("Parameter snapshot is required and cannot be null."); } Validator.validate(snapshot); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, snapshot, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -468,7 +468,7 @@ private ServiceResponse beginUpdateDelegate(Response getByResourceGroupAsync(String resourceGroup * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 SnapshotInner object */ @@ -512,7 +512,7 @@ public SnapshotInner call(ServiceResponse response) { * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 SnapshotInner object */ @@ -526,7 +526,7 @@ public Observable> getByResourceGroupWithServiceR if (snapshotName == null) { throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -552,7 +552,7 @@ private ServiceResponse getByResourceGroupDelegate(Response deleteAsync(String resourceGr * Deletes a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 for the request */ @@ -596,7 +596,7 @@ public OperationStatusResponseInner call(ServiceResponse> deleteWithServi if (snapshotName == null) { throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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()); } @@ -619,7 +619,7 @@ public Observable> deleteWithServi * Deletes a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -633,7 +633,7 @@ public OperationStatusResponseInner beginDelete(String resourceGroupName, String * Deletes a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -646,7 +646,7 @@ public ServiceFuture beginDeleteAsync(String resou * Deletes a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 */ @@ -663,7 +663,7 @@ public OperationStatusResponseInner call(ServiceResponse> beginDeleteWith if (snapshotName == null) { throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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>>() { @Override @@ -792,7 +792,7 @@ public Observable>> listByResourceGroupSingl if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -897,7 +897,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-03-30"; + final String apiVersion = "2018-04-01"; return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override @@ -923,7 +923,7 @@ private ServiceResponse> listDelegate(Response grantAccessAsync(String resourceGroupName, * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -970,7 +970,7 @@ public AccessUriInner call(ServiceResponse response) { * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -989,7 +989,7 @@ public Observable> grantAccessWithServiceRespons throw new IllegalArgumentException("Parameter grantAccessData is required and cannot be null."); } Validator.validate(grantAccessData); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; Observable> observable = service.grantAccess(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, grantAccessData, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -998,7 +998,7 @@ public Observable> grantAccessWithServiceRespons * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -1013,7 +1013,7 @@ public AccessUriInner beginGrantAccess(String resourceGroupName, String snapshot * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -1027,7 +1027,7 @@ public ServiceFuture beginGrantAccessAsync(String resourceGroupN * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object @@ -1045,7 +1045,7 @@ public AccessUriInner call(ServiceResponse response) { * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AccessUriInner object @@ -1064,7 +1064,7 @@ public Observable> beginGrantAccessWithServiceRe throw new IllegalArgumentException("Parameter grantAccessData is required and cannot be null."); } Validator.validate(grantAccessData); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2018-04-01"; return service.beginGrantAccess(this.client.subscriptionId(), resourceGroupName, snapshotName, apiVersion, grantAccessData, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1091,7 +1091,7 @@ private ServiceResponse beginGrantAccessDelegate(Response revokeAccessAsync(String reso * Revokes access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 for the request */ @@ -1135,7 +1135,7 @@ public OperationStatusResponseInner call(ServiceResponse> revokeAccessWit if (snapshotName == null) { throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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()); } @@ -1158,7 +1158,7 @@ public Observable> revokeAccessWit * Revokes access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -1172,7 +1172,7 @@ public OperationStatusResponseInner beginRevokeAccess(String resourceGroupName, * Revokes access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1185,7 +1185,7 @@ public ServiceFuture beginRevokeAccessAsync(String * Revokes access to a snapshot. * * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot within the given subscription and 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 */ @@ -1202,7 +1202,7 @@ public OperationStatusResponseInner call(ServiceResponse> beginRevokeAcce if (snapshotName == null) { throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); } - final String apiVersion = "2017-03-30"; + 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>>() { @Override 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/implementation/ThrottledRequestsInputInner.java new file mode 100644 index 00000000000..34a71d127f5 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/ThrottledRequestsInputInner.java @@ -0,0 +1,17 @@ +/** + * 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.LogAnalyticsInputBase; + +/** + * Api request input for LogAnalytics getThrottledRequests Api. + */ +public class ThrottledRequestsInputInner extends LogAnalyticsInputBase { +} 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..95b866ced05 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 @@ -18,7 +18,6 @@ import java.util.List; import com.microsoft.azure.management.compute.VirtualMachineIdentity; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.management.compute.VirtualMachineInstanceView; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -97,7 +96,7 @@ public class VirtualMachineInner extends Resource { * The virtual machine instance view. */ @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineInstanceView instanceView; + private VirtualMachineInstanceViewInner instanceView; /** * Specifies that the image or disk that is being used was licensed @@ -294,7 +293,7 @@ public String provisioningState() { * * @return the instanceView value */ - public VirtualMachineInstanceView instanceView() { + public VirtualMachineInstanceViewInner instanceView() { return this.instanceView; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInstanceViewInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInstanceViewInner.java new file mode 100644 index 00000000000..25f7cf32854 --- /dev/null +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInstanceViewInner.java @@ -0,0 +1,341 @@ +/** + * 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.VirtualMachineAgentInstanceView; +import com.microsoft.azure.management.compute.MaintenanceRedeployStatus; +import java.util.List; +import com.microsoft.azure.management.compute.DiskInstanceView; +import com.microsoft.azure.management.compute.VirtualMachineExtensionInstanceView; +import com.microsoft.azure.management.compute.BootDiagnosticsInstanceView; +import com.microsoft.azure.management.compute.InstanceViewStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of a virtual machine. + */ +public class VirtualMachineInstanceViewInner { + /** + * Specifies the update domain of the virtual machine. + */ + @JsonProperty(value = "platformUpdateDomain") + private Integer platformUpdateDomain; + + /** + * Specifies the fault domain of the virtual machine. + */ + @JsonProperty(value = "platformFaultDomain") + private Integer platformFaultDomain; + + /** + * The computer name assigned to the virtual machine. + */ + @JsonProperty(value = "computerName") + private String computerName; + + /** + * The Operating System running on the virtual machine. + */ + @JsonProperty(value = "osName") + private String osName; + + /** + * The version of Operating System running on the virtual machine. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /** + * The Remote desktop certificate thumbprint. + */ + @JsonProperty(value = "rdpThumbPrint") + private String rdpThumbPrint; + + /** + * The VM Agent running on the virtual machine. + */ + @JsonProperty(value = "vmAgent") + private VirtualMachineAgentInstanceView vmAgent; + + /** + * The Maintenance Operation status on the virtual machine. + */ + @JsonProperty(value = "maintenanceRedeployStatus") + private MaintenanceRedeployStatus maintenanceRedeployStatus; + + /** + * The virtual machine disk information. + */ + @JsonProperty(value = "disks") + private List disks; + + /** + * The extensions information. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** + * 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. + */ + @JsonProperty(value = "bootDiagnostics") + private BootDiagnosticsInstanceView bootDiagnostics; + + /** + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Get the platformUpdateDomain value. + * + * @return the platformUpdateDomain value + */ + public Integer platformUpdateDomain() { + return this.platformUpdateDomain; + } + + /** + * Set the platformUpdateDomain value. + * + * @param platformUpdateDomain the platformUpdateDomain value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withPlatformUpdateDomain(Integer platformUpdateDomain) { + this.platformUpdateDomain = platformUpdateDomain; + return this; + } + + /** + * Get the platformFaultDomain value. + * + * @return the platformFaultDomain value + */ + public Integer platformFaultDomain() { + return this.platformFaultDomain; + } + + /** + * Set the platformFaultDomain value. + * + * @param platformFaultDomain the platformFaultDomain value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withPlatformFaultDomain(Integer platformFaultDomain) { + this.platformFaultDomain = platformFaultDomain; + return this; + } + + /** + * Get the computerName value. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName value. + * + * @param computerName the computerName value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the osName value. + * + * @return the osName value + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName value. + * + * @param osName the osName value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the osVersion value. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion value. + * + * @param osVersion the osVersion value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the rdpThumbPrint value. + * + * @return the rdpThumbPrint value + */ + public String rdpThumbPrint() { + return this.rdpThumbPrint; + } + + /** + * Set the rdpThumbPrint value. + * + * @param rdpThumbPrint the rdpThumbPrint value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withRdpThumbPrint(String rdpThumbPrint) { + this.rdpThumbPrint = rdpThumbPrint; + return this; + } + + /** + * Get the vmAgent value. + * + * @return the vmAgent value + */ + public VirtualMachineAgentInstanceView vmAgent() { + return this.vmAgent; + } + + /** + * Set the vmAgent value. + * + * @param vmAgent the vmAgent value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withVmAgent(VirtualMachineAgentInstanceView vmAgent) { + this.vmAgent = vmAgent; + return this; + } + + /** + * Get the maintenanceRedeployStatus value. + * + * @return the maintenanceRedeployStatus value + */ + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.maintenanceRedeployStatus; + } + + /** + * Set the maintenanceRedeployStatus value. + * + * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withMaintenanceRedeployStatus(MaintenanceRedeployStatus maintenanceRedeployStatus) { + this.maintenanceRedeployStatus = maintenanceRedeployStatus; + return this; + } + + /** + * Get the disks value. + * + * @return the disks value + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks value. + * + * @param disks the disks value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the extensions value. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions value. + * + * @param extensions the extensions value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the bootDiagnostics value. + * + * @return the bootDiagnostics value + */ + public BootDiagnosticsInstanceView bootDiagnostics() { + return this.bootDiagnostics; + } + + /** + * Set the bootDiagnostics value. + * + * @param bootDiagnostics the bootDiagnostics value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withBootDiagnostics(BootDiagnosticsInstanceView bootDiagnostics) { + this.bootDiagnostics = bootDiagnostics; + return this; + } + + /** + * Get the statuses value. + * + * @return the statuses value + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses value. + * + * @param statuses the statuses value to set + * @return the VirtualMachineInstanceViewInner object itself. + */ + public VirtualMachineInstanceViewInner withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + +} 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 061cd13eb6c..c894387fd06 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-03-30"; + final String apiVersion = "2017-12-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-03-30"; + final String apiVersion = "2017-12-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/VirtualMachineScaleSetInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetInner.java index 74282f47593..2bc0e32a743 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 @@ -79,6 +79,19 @@ public class VirtualMachineScaleSetInner extends Resource { @JsonProperty(value = "properties.singlePlacementGroup") private Boolean singlePlacementGroup; + /** + * Whether to force stictly even Virtual Machine distribution cross x-zones + * in case there is zone outage. + */ + @JsonProperty(value = "properties.zoneBalance") + private Boolean zoneBalance; + + /** + * Fault Domain count for each placement group. + */ + @JsonProperty(value = "properties.platformFaultDomainCount") + private Integer platformFaultDomainCount; + /** * The identity of the virtual machine scale set, if configured. */ @@ -229,6 +242,46 @@ public VirtualMachineScaleSetInner withSinglePlacementGroup(Boolean singlePlacem return this; } + /** + * Get the zoneBalance value. + * + * @return the zoneBalance value + */ + public Boolean zoneBalance() { + return this.zoneBalance; + } + + /** + * Set the zoneBalance value. + * + * @param zoneBalance the zoneBalance value to set + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withZoneBalance(Boolean zoneBalance) { + this.zoneBalance = zoneBalance; + return this; + } + + /** + * Get the platformFaultDomainCount value. + * + * @return the platformFaultDomainCount value + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount value. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set + * @return the VirtualMachineScaleSetInner object itself. + */ + public VirtualMachineScaleSetInner withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + /** * Get the identity value. * 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/implementation/VirtualMachineScaleSetNetworkConfigurationInner.java index d9d1339f4a5..3c9b28a3014 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/implementation/VirtualMachineScaleSetNetworkConfigurationInner.java @@ -58,6 +58,12 @@ public class VirtualMachineScaleSetNetworkConfigurationInner extends SubResource @JsonProperty(value = "properties.ipConfigurations", required = true) private List ipConfigurations; + /** + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + /** * Get the name value. * @@ -178,4 +184,24 @@ public VirtualMachineScaleSetNetworkConfigurationInner withIpConfigurations(List return this; } + /** + * Get the enableIPForwarding value. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set the enableIPForwarding value. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the VirtualMachineScaleSetNetworkConfigurationInner object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + 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/implementation/VirtualMachineScaleSetUpdateNetworkConfigurationInner.java index 1663cf15a7a..f5d03c6fd32 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/implementation/VirtualMachineScaleSetUpdateNetworkConfigurationInner.java @@ -57,6 +57,12 @@ public class VirtualMachineScaleSetUpdateNetworkConfigurationInner extends SubRe @JsonProperty(value = "properties.ipConfigurations") private List ipConfigurations; + /** + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "properties.enableIPForwarding") + private Boolean enableIPForwarding; + /** * Get the name value. * @@ -177,4 +183,24 @@ public VirtualMachineScaleSetUpdateNetworkConfigurationInner withIpConfiguration return this; } + /** + * Get the enableIPForwarding value. + * + * @return the enableIPForwarding value + */ + public Boolean enableIPForwarding() { + return this.enableIPForwarding; + } + + /** + * Set the enableIPForwarding value. + * + * @param enableIPForwarding the enableIPForwarding value to set + * @return the VirtualMachineScaleSetUpdateNetworkConfigurationInner object itself. + */ + public VirtualMachineScaleSetUpdateNetworkConfigurationInner withEnableIPForwarding(Boolean enableIPForwarding) { + this.enableIPForwarding = enableIPForwarding; + return this; + } + } 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..cd11fc0dadc 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 @@ -18,7 +18,6 @@ import com.microsoft.azure.management.compute.Plan; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.azure.management.compute.VirtualMachineInstanceView; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -56,7 +55,7 @@ public class VirtualMachineScaleSetVMInner extends Resource { * The virtual machine instance view. */ @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineInstanceView instanceView; + private VirtualMachineInstanceViewInner instanceView; /** * Specifies the hardware settings for the virtual machine. @@ -186,7 +185,7 @@ public String vmId() { * * @return the instanceView value */ - public VirtualMachineInstanceView instanceView() { + public VirtualMachineInstanceViewInner instanceView() { return this.instanceView; } 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 95d03b488b9..d7e523a6abb 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 @@ -9,6 +9,7 @@ package com.microsoft.azure.management.compute.implementation; import com.microsoft.azure.management.compute.VirtualMachineAgentInstanceView; +import com.microsoft.azure.management.compute.MaintenanceRedeployStatus; import java.util.List; import com.microsoft.azure.management.compute.DiskInstanceView; import com.microsoft.azure.management.compute.VirtualMachineExtensionInstanceView; @@ -45,6 +46,12 @@ public class VirtualMachineScaleSetVMInstanceViewInner { @JsonProperty(value = "vmAgent") private VirtualMachineAgentInstanceView vmAgent; + /** + * The Maintenance Operation status on the virtual machine. + */ + @JsonProperty(value = "maintenanceRedeployStatus") + private MaintenanceRedeployStatus maintenanceRedeployStatus; + /** * The disks information. */ @@ -167,6 +174,26 @@ public VirtualMachineScaleSetVMInstanceViewInner withVmAgent(VirtualMachineAgent return this; } + /** + * Get the maintenanceRedeployStatus value. + * + * @return the maintenanceRedeployStatus value + */ + public MaintenanceRedeployStatus maintenanceRedeployStatus() { + return this.maintenanceRedeployStatus; + } + + /** + * Set the maintenanceRedeployStatus value. + * + * @param maintenanceRedeployStatus the maintenanceRedeployStatus value to set + * @return the VirtualMachineScaleSetVMInstanceViewInner object itself. + */ + public VirtualMachineScaleSetVMInstanceViewInner withMaintenanceRedeployStatus(MaintenanceRedeployStatus maintenanceRedeployStatus) { + this.maintenanceRedeployStatus = maintenanceRedeployStatus; + return this; + } + /** * Get the disks value. * diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java index 72c6a79a93c..b7c3251ed48 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java @@ -18,15 +18,18 @@ 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.POST; +import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; import retrofit2.Response; @@ -83,6 +86,14 @@ interface VirtualMachineScaleSetVMsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") Observable> beginDeallocate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs update" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMInner 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.VirtualMachineScaleSetVMs beginUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Body VirtualMachineScaleSetVMInner 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.VirtualMachineScaleSetVMs delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -127,6 +138,22 @@ interface VirtualMachineScaleSetVMsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs redeploy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") + Observable> redeploy(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs beginRedeploy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") + Observable> beginRedeploy(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs performMaintenance" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") + Observable> performMaintenance(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs beginPerformMaintenance" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") + Observable> beginPerformMaintenance(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("instanceId") String instanceId, @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.VirtualMachineScaleSetVMs listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -631,6 +658,188 @@ private ServiceResponse beginDeallocateDelegate(Re .build(response); } + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM 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 VirtualMachineScaleSetVMInner object if successful. + */ + public VirtualMachineScaleSetVMInner update(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).toBlocking().last().body(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters), serviceCallback); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).map(new Func1, VirtualMachineScaleSetVMInner>() { + @Override + public VirtualMachineScaleSetVMInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-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()); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM 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 VirtualMachineScaleSetVMInner object if successful. + */ + public VirtualMachineScaleSetVMInner beginUpdate(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).toBlocking().single().body(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters), serviceCallback); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineScaleSetVMInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).map(new Func1, VirtualMachineScaleSetVMInner>() { + @Override + public VirtualMachineScaleSetVMInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineScaleSetVMInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-12-01"; + return service.beginUpdate(resourceGroupName, vmScaleSetName, instanceId, 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(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Deletes a virtual machine from a VM scale set. * @@ -1731,6 +1940,338 @@ private ServiceResponse beginStartDelegate(Respons .build(response); } + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-12-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()); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner beginRedeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Redeploys a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-12-01"; + return service.beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRedeployDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().body(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> performMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-12-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()); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable> beginPerformMaintenanceWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmScaleSetName == null) { + throw new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."); + } + if (instanceId == null) { + throw new IllegalArgumentException("Parameter instanceId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2017-12-01"; + return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + /** * Gets a list of all virtual machines in a VM scale sets. * 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 13856d034a9..9ca36448448 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 @@ -152,6 +152,22 @@ interface VirtualMachineScaleSetsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start") Observable> beginStart(@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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets redeploy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy") + Observable> redeploy(@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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets beginRedeploy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy") + Observable> beginRedeploy(@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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets performMaintenance" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") + Observable> performMaintenance(@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); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets beginPerformMaintenance" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") + Observable> beginPerformMaintenance(@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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets updateInstances" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") Observable> updateInstances(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, @Header("User-Agent") String userAgent); @@ -176,6 +192,10 @@ interface VirtualMachineScaleSetsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall") Observable> beginReimageAll(@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); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineScaleSets forceRecoveryServiceFabricPlatformUpdateDomainWalk" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk") + Observable> forceRecoveryServiceFabricPlatformUpdateDomainWalk(@Path("resourceGroupName") String resourceGroupName, @Path("vmScaleSetName") String vmScaleSetName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("platformUpdateDomain") int platformUpdateDomain, @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 listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -2642,45 +2662,42 @@ private ServiceResponse beginStartDelegate(Respons } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @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 * @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 OperationStatusResponseInner redeploy(String resourceGroupName, String vmScaleSetName) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. * @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 updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + public ServiceFuture redeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @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 for the request */ - public Observable updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -2689,15 +2706,14 @@ public OperationStatusResponseInner call(ServiceResponse> updateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2707,57 +2723,127 @@ public Observable> updateInstances if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (instanceIds == null) { - throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); + final String apiVersion = "2017-12-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()); + } + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + * @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(); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @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 redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 for the request + */ + public Observable redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 for the request + */ + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); } Validator.validate(instanceIds); final String apiVersion = "2017-12-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()); + 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()); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @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 * @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 OperationStatusResponseInner beginRedeploy(String resourceGroupName, String vmScaleSetName) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. * @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 beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + public ServiceFuture beginRedeployAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Redeploy one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @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 */ - public Observable beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -2766,15 +2852,14 @@ public OperationStatusResponseInner call(ServiceResponse> beginUpdateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2784,19 +2869,103 @@ public Observable> beginUpdateInst if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (instanceIds == null) { - throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); + final String apiVersion = "2017-12-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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRedeployDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + * @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, List instanceIds) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @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 beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Redeploy one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); } Validator.validate(instanceIds); final String apiVersion = "2017-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return service.beginUpdateInstances(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()) + 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>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginUpdateInstancesDelegate(response); + ServiceResponse clientResponse = beginRedeployDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -2805,7 +2974,7 @@ public Observable> call(Response beginUpdateInstancesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + 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()) @@ -2814,7 +2983,7 @@ private ServiceResponse beginUpdateInstancesDelega } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2823,12 +2992,12 @@ private ServiceResponse beginUpdateInstancesDelega * @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 OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2836,20 +3005,20 @@ 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) { - return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable reimageAsync(String resourceGroupName, String vmScaleSetName) { - return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable performMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -2858,14 +3027,14 @@ public OperationStatusResponseInner call(ServiceResponse> reimageWithServiceResponseAsync(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."); } @@ -2879,11 +3048,11 @@ public Observable> reimageWithServ 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()); + 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()); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2893,12 +3062,12 @@ public Observable> reimageWithServ * @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 OperationStatusResponseInner performMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2907,12 +3076,12 @@ 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) { - return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + public ServiceFuture performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2920,8 +3089,8 @@ 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 performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return performMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -2930,7 +3099,7 @@ public OperationStatusResponseInner call(ServiceResponse> reimageWithServiceResponseAsync(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."); } @@ -2955,12 +3124,12 @@ public Observable> reimageWithServ vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } - Observable> observable = service.reimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()); + 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()); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2969,12 +3138,12 @@ public Observable> reimageWithServ * @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 OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmScaleSetName) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body(); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -2982,20 +3151,20 @@ 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) { - return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationStatusResponseInner object */ - public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -3004,14 +3173,14 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageWithServiceResponseAsync(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."); } @@ -3025,12 +3194,12 @@ public Observable> beginReimageWit 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()) + return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginReimageDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3040,7 +3209,7 @@ public Observable> call(Response> call(Response instanceIds) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + public OperationStatusResponseInner beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -3064,12 +3233,12 @@ 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) { - return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + public ServiceFuture beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * Perform maintenance on one or more virtual machines in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -3077,8 +3246,8 @@ public ServiceFuture beginReimageAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationStatusResponseInner object */ - public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + public Observable beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { return response.body(); @@ -3087,7 +3256,7 @@ public OperationStatusResponseInner call(ServiceResponse> beginReimageWithServiceResponseAsync(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."); } @@ -3112,12 +3281,12 @@ public Observable> beginReimageWit vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs(); vmInstanceIDs.withInstanceIds(instanceIds); } - return service.beginReimage(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()) + return service.beginPerformMaintenance(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), vmInstanceIDs, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginReimageDelegate(response); + ServiceResponse clientResponse = beginPerformMaintenanceDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -3126,7 +3295,7 @@ public Observable> call(Response beginReimageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + 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()) @@ -3135,41 +3304,534 @@ private ServiceResponse beginReimageDelegate(Respo } /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @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 * @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 OperationStatusResponseInner updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body(); } /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. * @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 reimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + public ServiceFuture updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @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 for the request */ - public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName) { + public Observable updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @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 for the request + */ + public Observable> updateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); + } + if (instanceIds == null) { + throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); + } + Validator.validate(instanceIds); + final String apiVersion = "2017-12-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()); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @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 + * @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(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @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 beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable> beginUpdateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); + } + if (instanceIds == null) { + throw new IllegalArgumentException("Parameter instanceIds is required and cannot be null."); + } + Validator.validate(instanceIds); + final String apiVersion = "2017-12-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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateInstancesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @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 reimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, 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 = "2017-12-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()); + } + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + * @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(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @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 reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 for the request + */ + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 for the request + */ + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); + } + Validator.validate(instanceIds); + final String apiVersion = "2017-12-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()); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @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 beginReimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, 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 = "2017-12-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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginReimageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + * @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, List instanceIds) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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. + * @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 beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @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 + */ + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + 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."); + } + Validator.validate(instanceIds); + final String apiVersion = "2017-12-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>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginReimageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + 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); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @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 OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName) { + return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @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 reimageAllAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable reimageAllAsync(String resourceGroupName, String vmScaleSetName) { return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, OperationStatusResponseInner>() { @Override public OperationStatusResponseInner call(ServiceResponse response) { @@ -3455,6 +4117,94 @@ private ServiceResponse beginReimageAllDelegate(Re .build(response); } + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested + * @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 RecoveryWalkResponseInner object if successful. + */ + public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain).toBlocking().single().body(); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested + * @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 forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain), serviceCallback); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoveryWalkResponseInner object + */ + public Observable forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync(resourceGroupName, vmScaleSetName, platformUpdateDomain).map(new Func1, RecoveryWalkResponseInner>() { + @Override + public RecoveryWalkResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoveryWalkResponseInner object + */ + public Observable> forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { + 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 = "2017-12-01"; + return service.forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, this.client.subscriptionId(), apiVersion, platformUpdateDomain, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = forceRecoveryServiceFabricPlatformUpdateDomainWalkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse forceRecoveryServiceFabricPlatformUpdateDomainWalkDelegate(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); + } + /** * Gets a list of all VM scale sets under a resource group. * 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 73c8e8c5ffc..01719d2b67c 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,7 +8,6 @@ package com.microsoft.azure.management.compute.implementation; -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; import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -852,9 +851,9 @@ private ServiceResponse getByResourceGroupDelegate(Response * @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 VirtualMachineInstanceView object if successful. + * @return the VirtualMachineInstanceViewInner object if successful. */ - public VirtualMachineInstanceView instanceView(String resourceGroupName, String vmName) { + public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName) { return instanceViewWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body(); } @@ -867,7 +866,7 @@ public VirtualMachineInstanceView instanceView(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture instanceViewAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { + public ServiceFuture instanceViewAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(instanceViewWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } @@ -877,12 +876,12 @@ public ServiceFuture instanceViewAsync(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 VirtualMachineInstanceView object + * @return the observable to the VirtualMachineInstanceViewInner object */ - public Observable instanceViewAsync(String resourceGroupName, String vmName) { - return instanceViewWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, VirtualMachineInstanceView>() { + public Observable instanceViewAsync(String resourceGroupName, String vmName) { + return instanceViewWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, VirtualMachineInstanceViewInner>() { @Override - public VirtualMachineInstanceView call(ServiceResponse response) { + public VirtualMachineInstanceViewInner call(ServiceResponse response) { return response.body(); } }); @@ -894,9 +893,9 @@ public VirtualMachineInstanceView call(ServiceResponse> instanceViewWithServiceResponseAsync(String resourceGroupName, String vmName) { + public Observable> instanceViewWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -908,11 +907,11 @@ public Observable> instanceViewWithS } final String apiVersion = "2017-12-01"; return service.instanceView(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 = instanceViewDelegate(response); + ServiceResponse clientResponse = instanceViewDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -921,9 +920,9 @@ public Observable> call(Response instanceViewDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse instanceViewDelegate(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); } @@ -2449,7 +2448,7 @@ public Observable> runCommandWithServiceR throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2017-12-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()); } @@ -2524,7 +2523,7 @@ public Observable> beginRunCommandWithSer throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); - final String apiVersion = "2017-03-30"; + final String apiVersion = "2017-12-01"; return service.beginRunCommand(resourceGroupName, vmName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override