From fc3ce8af9e0eaf7cf1a08d9dbe49a29137546e55 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 31 Jul 2019 07:36:56 +0000 Subject: [PATCH] Generated from 368b5914a375e09ef413285c932b72038a8af7e4 fix: sql preview model validation errors - Remove empty "body" for RESPONSE_SCHEMA_NOT_IN_SPEC errors - IsAzureMonitorTargetEnabled -> isAzureMonitorTargetEnabled - "State" -> "state" - emailAccountAdmins "true" -> true - Add 202 response for RestorePoints_Create - password -> certPassword for ManagedInstanceTdeCertificates_Create and TdeCertificates_Create --- .../v2015_05_01_preview/pom.xml | 4 +- .../DatabaseBlobAuditingPolicy.java | 4 +- .../v2015_05_01_preview/ManagedInstance.java | 242 ++++- .../ManagedInstanceLicenseType.java | 41 + .../ManagedInstanceProxyOverride.java | 44 + .../ManagedInstanceUpdate.java | 244 ++++- .../ManagedServerCreateMode.java | 41 + .../RecommendedActionStateInfo.java | 10 +- .../v2015_05_01_preview/VirtualCluster.java | 65 ++ .../VirtualClusterUpdate.java | 104 ++ .../v2015_05_01_preview/VirtualClusters.java | 24 + .../implementation/AdvisorInner.java | 8 +- .../DatabaseBlobAuditingPolicyInner.java | 8 +- .../implementation/ManagedInstanceImpl.java | 113 +- .../implementation/ManagedInstanceInner.java | 254 ++++- .../implementation/ManagedInstancesInner.java | 268 ++--- .../SqlManagementClientImpl.java | 14 + .../implementation/SqlManager.java | 12 + .../implementation/VirtualClusterImpl.java | 81 ++ .../implementation/VirtualClusterInner.java | 78 ++ .../implementation/VirtualClustersImpl.java | 133 +++ .../implementation/VirtualClustersInner.java | 963 ++++++++++++++++++ 22 files changed, 2563 insertions(+), 192 deletions(-) create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceLicenseType.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceProxyOverride.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedServerCreateMode.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualCluster.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusterUpdate.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusters.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClusterImpl.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClusterInner.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersImpl.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersInner.java diff --git a/sql/resource-manager/v2015_05_01_preview/pom.xml b/sql/resource-manager/v2015_05_01_preview/pom.xml index 96d2be996b04..77ff5936689c 100644 --- a/sql/resource-manager/v2015_05_01_preview/pom.xml +++ b/sql/resource-manager/v2015_05_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.1.0 - ../../../pom.management.xml + 0.0.3-beta + ../../../pom.xml azure-mgmt-sql 1.0.0-beta diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/DatabaseBlobAuditingPolicy.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/DatabaseBlobAuditingPolicy.java index 297a35975dea..c29b9db6977f 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/DatabaseBlobAuditingPolicy.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/DatabaseBlobAuditingPolicy.java @@ -189,7 +189,7 @@ interface WithIsAzureMonitorTargetEnabled { /** * Specifies isAzureMonitorTargetEnabled. * @param isAzureMonitorTargetEnabled Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}. Diagnostic Settings URI format: @@ -342,7 +342,7 @@ interface WithIsAzureMonitorTargetEnabled { /** * Specifies isAzureMonitorTargetEnabled. * @param isAzureMonitorTargetEnabled Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}. Diagnostic Settings URI format: diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java index 8b419867091b..4b8baf1a2c5f 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java @@ -18,6 +18,7 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.sql.v2015_05_01_preview.implementation.SqlManager; +import org.joda.time.DateTime; import com.microsoft.azure.management.sql.v2015_05_01_preview.implementation.ManagedInstanceInner; /** @@ -59,16 +60,46 @@ public interface ManagedInstance extends HasInner, Resourc */ ResourceIdentity identity(); + /** + * @return the instancePoolId value. + */ + String instancePoolId(); + /** * @return the licenseType value. */ - String licenseType(); + ManagedInstanceLicenseType licenseType(); + + /** + * @return the managedInstanceCreateMode value. + */ + ManagedServerCreateMode managedInstanceCreateMode(); + + /** + * @return the proxyOverride value. + */ + ManagedInstanceProxyOverride proxyOverride(); + + /** + * @return the publicDataEndpointEnabled value. + */ + Boolean publicDataEndpointEnabled(); + + /** + * @return the restorePointInTime value. + */ + DateTime restorePointInTime(); /** * @return the sku value. */ Sku sku(); + /** + * @return the sourceManagedInstanceId value. + */ + String sourceManagedInstanceId(); + /** * @return the state value. */ @@ -84,6 +115,11 @@ public interface ManagedInstance extends HasInner, Resourc */ String subnetId(); + /** + * @return the timezoneId value. + */ + String timezoneId(); + /** * @return the vCores value. */ @@ -171,16 +207,78 @@ interface WithIdentity { WithCreate withIdentity(ResourceIdentity identity); } + /** + * The stage of the managedinstance definition allowing to specify InstancePoolId. + */ + interface WithInstancePoolId { + /** + * Specifies instancePoolId. + * @param instancePoolId The Id of the instance pool this managed server belongs to + * @return the next definition stage + */ + WithCreate withInstancePoolId(String instancePoolId); + } + /** * The stage of the managedinstance definition allowing to specify LicenseType. */ interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType The license type. Possible values are 'LicenseIncluded' and 'BasePrice' + * @param licenseType The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice' + * @return the next definition stage + */ + WithCreate withLicenseType(ManagedInstanceLicenseType licenseType); + } + + /** + * The stage of the managedinstance definition allowing to specify ManagedInstanceCreateMode. + */ + interface WithManagedInstanceCreateMode { + /** + * Specifies managedInstanceCreateMode. + * @param managedInstanceCreateMode Specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore' + * @return the next definition stage + */ + WithCreate withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode); + } + + /** + * The stage of the managedinstance definition allowing to specify ProxyOverride. + */ + interface WithProxyOverride { + /** + * Specifies proxyOverride. + * @param proxyOverride Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' + * @return the next definition stage + */ + WithCreate withProxyOverride(ManagedInstanceProxyOverride proxyOverride); + } + + /** + * The stage of the managedinstance definition allowing to specify PublicDataEndpointEnabled. + */ + interface WithPublicDataEndpointEnabled { + /** + * Specifies publicDataEndpointEnabled. + * @param publicDataEndpointEnabled Whether or not the public data endpoint is enabled * @return the next definition stage */ - WithCreate withLicenseType(String licenseType); + WithCreate withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled); + } + + /** + * The stage of the managedinstance definition allowing to specify RestorePointInTime. + */ + interface WithRestorePointInTime { + /** + * Specifies restorePointInTime. + * @param restorePointInTime Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database + * @return the next definition stage + */ + WithCreate withRestorePointInTime(DateTime restorePointInTime); } /** @@ -189,19 +287,31 @@ interface WithLicenseType { interface WithSku { /** * Specifies sku. - * @param sku Managed instance sku + * @param sku Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 * @return the next definition stage */ WithCreate withSku(Sku sku); } + /** + * The stage of the managedinstance definition allowing to specify SourceManagedInstanceId. + */ + interface WithSourceManagedInstanceId { + /** + * Specifies sourceManagedInstanceId. + * @param sourceManagedInstanceId The resource identifier of the source managed instance associated with create operation of this instance + * @return the next definition stage + */ + WithCreate withSourceManagedInstanceId(String sourceManagedInstanceId); + } + /** * The stage of the managedinstance definition allowing to specify StorageSizeInGB. */ interface WithStorageSizeInGB { /** * Specifies storageSizeInGB. - * @param storageSizeInGB The maximum storage size in GB + * @param storageSizeInGB Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only * @return the next definition stage */ WithCreate withStorageSizeInGB(Integer storageSizeInGB); @@ -219,13 +329,30 @@ interface WithSubnetId { WithCreate withSubnetId(String subnetId); } + /** + * The stage of the managedinstance definition allowing to specify TimezoneId. + */ + interface WithTimezoneId { + /** + * Specifies timezoneId. + * @param timezoneId Id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time" + * @return the next definition stage + */ + WithCreate withTimezoneId(String timezoneId); + } + /** * The stage of the managedinstance definition allowing to specify VCores. */ interface WithVCores { /** * Specifies vCores. - * @param vCores The number of VCores + * @param vCores The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80 * @return the next definition stage */ WithCreate withVCores(Integer vCores); @@ -236,13 +363,13 @@ interface WithVCores { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithLicenseType, DefinitionStages.WithSku, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithVCores { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { } } /** * The template for a ManagedInstance update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithLicenseType, UpdateStages.WithSku, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithVCores { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { } /** @@ -297,16 +424,78 @@ interface WithDnsZonePartner { Update withDnsZonePartner(String dnsZonePartner); } + /** + * The stage of the managedinstance update allowing to specify InstancePoolId. + */ + interface WithInstancePoolId { + /** + * Specifies instancePoolId. + * @param instancePoolId The Id of the instance pool this managed server belongs to + * @return the next update stage + */ + Update withInstancePoolId(String instancePoolId); + } + /** * The stage of the managedinstance update allowing to specify LicenseType. */ interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType The license type. Possible values are 'LicenseIncluded' and 'BasePrice' + * @param licenseType The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice' + * @return the next update stage + */ + Update withLicenseType(ManagedInstanceLicenseType licenseType); + } + + /** + * The stage of the managedinstance update allowing to specify ManagedInstanceCreateMode. + */ + interface WithManagedInstanceCreateMode { + /** + * Specifies managedInstanceCreateMode. + * @param managedInstanceCreateMode Specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore' + * @return the next update stage + */ + Update withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode); + } + + /** + * The stage of the managedinstance update allowing to specify ProxyOverride. + */ + interface WithProxyOverride { + /** + * Specifies proxyOverride. + * @param proxyOverride Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' + * @return the next update stage + */ + Update withProxyOverride(ManagedInstanceProxyOverride proxyOverride); + } + + /** + * The stage of the managedinstance update allowing to specify PublicDataEndpointEnabled. + */ + interface WithPublicDataEndpointEnabled { + /** + * Specifies publicDataEndpointEnabled. + * @param publicDataEndpointEnabled Whether or not the public data endpoint is enabled + * @return the next update stage + */ + Update withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled); + } + + /** + * The stage of the managedinstance update allowing to specify RestorePointInTime. + */ + interface WithRestorePointInTime { + /** + * Specifies restorePointInTime. + * @param restorePointInTime Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database * @return the next update stage */ - Update withLicenseType(String licenseType); + Update withRestorePointInTime(DateTime restorePointInTime); } /** @@ -321,13 +510,25 @@ interface WithSku { Update withSku(Sku sku); } + /** + * The stage of the managedinstance update allowing to specify SourceManagedInstanceId. + */ + interface WithSourceManagedInstanceId { + /** + * Specifies sourceManagedInstanceId. + * @param sourceManagedInstanceId The resource identifier of the source managed instance associated with create operation of this instance + * @return the next update stage + */ + Update withSourceManagedInstanceId(String sourceManagedInstanceId); + } + /** * The stage of the managedinstance update allowing to specify StorageSizeInGB. */ interface WithStorageSizeInGB { /** * Specifies storageSizeInGB. - * @param storageSizeInGB The maximum storage size in GB + * @param storageSizeInGB Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only * @return the next update stage */ Update withStorageSizeInGB(Integer storageSizeInGB); @@ -345,13 +546,30 @@ interface WithSubnetId { Update withSubnetId(String subnetId); } + /** + * The stage of the managedinstance update allowing to specify TimezoneId. + */ + interface WithTimezoneId { + /** + * Specifies timezoneId. + * @param timezoneId Id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time" + * @return the next update stage + */ + Update withTimezoneId(String timezoneId); + } + /** * The stage of the managedinstance update allowing to specify VCores. */ interface WithVCores { /** * Specifies vCores. - * @param vCores The number of VCores + * @param vCores The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80 * @return the next update stage */ Update withVCores(Integer vCores); diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceLicenseType.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceLicenseType.java new file mode 100644 index 000000000000..2fdac3314c3a --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceLicenseType.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.sql.v2015_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedInstanceLicenseType. + */ +public final class ManagedInstanceLicenseType extends ExpandableStringEnum { + /** Static value LicenseIncluded for ManagedInstanceLicenseType. */ + public static final ManagedInstanceLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); + + /** Static value BasePrice for ManagedInstanceLicenseType. */ + public static final ManagedInstanceLicenseType BASE_PRICE = fromString("BasePrice"); + + /** + * Creates or finds a ManagedInstanceLicenseType from its string representation. + * @param name a name to look for + * @return the corresponding ManagedInstanceLicenseType + */ + @JsonCreator + public static ManagedInstanceLicenseType fromString(String name) { + return fromString(name, ManagedInstanceLicenseType.class); + } + + /** + * @return known ManagedInstanceLicenseType values + */ + public static Collection values() { + return values(ManagedInstanceLicenseType.class); + } +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceProxyOverride.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceProxyOverride.java new file mode 100644 index 000000000000..3ad67fc38a27 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceProxyOverride.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.sql.v2015_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedInstanceProxyOverride. + */ +public final class ManagedInstanceProxyOverride extends ExpandableStringEnum { + /** Static value Proxy for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride PROXY = fromString("Proxy"); + + /** Static value Redirect for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride REDIRECT = fromString("Redirect"); + + /** Static value Default for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride DEFAULT = fromString("Default"); + + /** + * Creates or finds a ManagedInstanceProxyOverride from its string representation. + * @param name a name to look for + * @return the corresponding ManagedInstanceProxyOverride + */ + @JsonCreator + public static ManagedInstanceProxyOverride fromString(String name) { + return fromString(name, ManagedInstanceProxyOverride.class); + } + + /** + * @return known ManagedInstanceProxyOverride values + */ + public static Collection values() { + return values(ManagedInstanceProxyOverride.class); + } +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java index 9e4b6b717db4..5ce66ed3f1a5 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.sql.v2015_05_01_preview; +import org.joda.time.DateTime; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -23,6 +24,18 @@ public class ManagedInstanceUpdate { @JsonProperty(value = "sku") private Sku sku; + /** + * Specifies the mode of database creation. + * + * Default: Regular instance creation. + * + * Restore: Creates an instance by restoring a set of backups to specific + * point in time. RestorePointInTime and SourceManagedInstanceId must be + * specified. Possible values include: 'Default', 'PointInTimeRestore'. + */ + @JsonProperty(value = "properties.managedInstanceCreateMode") + private ManagedServerCreateMode managedInstanceCreateMode; + /** * The fully qualified domain name of the managed instance. */ @@ -57,19 +70,23 @@ public class ManagedInstanceUpdate { private String state; /** - * The license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * The license type. Possible values are 'LicenseIncluded' (regular price + * inclusive of a new SQL license) and 'BasePrice' (discounted AHB price + * for bringing your own SQL licenses). Possible values include: + * 'LicenseIncluded', 'BasePrice'. */ @JsonProperty(value = "properties.licenseType") - private String licenseType; + private ManagedInstanceLicenseType licenseType; /** - * The number of VCores. + * The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. */ @JsonProperty(value = "properties.vCores") private Integer vCores; /** - * The maximum storage size in GB. + * Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments + * of 32 GB allowed only. */ @JsonProperty(value = "properties.storageSizeInGB") private Integer storageSizeInGB; @@ -93,6 +110,55 @@ public class ManagedInstanceUpdate { @JsonProperty(value = "properties.dnsZonePartner") private String dnsZonePartner; + /** + * Whether or not the public data endpoint is enabled. + */ + @JsonProperty(value = "properties.publicDataEndpointEnabled") + private Boolean publicDataEndpointEnabled; + + /** + * The resource identifier of the source managed instance associated with + * create operation of this instance. + */ + @JsonProperty(value = "properties.sourceManagedInstanceId") + private String sourceManagedInstanceId; + + /** + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. + */ + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; + + /** + * Connection type used for connecting to the instance. Possible values + * include: 'Proxy', 'Redirect', 'Default'. + */ + @JsonProperty(value = "properties.proxyOverride") + private ManagedInstanceProxyOverride proxyOverride; + + /** + * Id of the timezone. Allowed values are timezones supported by Windows. + * Windows keeps details on supported timezones, including the id, in + * registry under + * KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time + * Zones. + * You can get those registry values via SQL Server by querying SELECT name + * AS timezone_id FROM sys.time_zone_info. + * List of Ids can also be obtained by executing + * [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + * An example of valid timezone id is "Pacific Standard Time" or "W. Europe + * Standard Time". + */ + @JsonProperty(value = "properties.timezoneId") + private String timezoneId; + + /** + * The Id of the instance pool this managed server belongs to. + */ + @JsonProperty(value = "properties.instancePoolId") + private String instancePoolId; + /** * Resource tags. */ @@ -119,6 +185,30 @@ public ManagedInstanceUpdate withSku(Sku sku) { return this; } + /** + * Get specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @return the managedInstanceCreateMode value + */ + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.managedInstanceCreateMode; + } + + /** + * Set specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @param managedInstanceCreateMode the managedInstanceCreateMode value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + this.managedInstanceCreateMode = managedInstanceCreateMode; + return this; + } + /** * Get the fully qualified domain name of the managed instance. * @@ -198,27 +288,27 @@ public String state() { } /** - * Get the license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * Get the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. * * @return the licenseType value */ - public String licenseType() { + public ManagedInstanceLicenseType licenseType() { return this.licenseType; } /** - * Set the license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * Set the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. * * @param licenseType the licenseType value to set * @return the ManagedInstanceUpdate object itself. */ - public ManagedInstanceUpdate withLicenseType(String licenseType) { + public ManagedInstanceUpdate withLicenseType(ManagedInstanceLicenseType licenseType) { this.licenseType = licenseType; return this; } /** - * Get the number of VCores. + * Get the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. * * @return the vCores value */ @@ -227,7 +317,7 @@ public Integer vCores() { } /** - * Set the number of VCores. + * Set the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. * * @param vCores the vCores value to set * @return the ManagedInstanceUpdate object itself. @@ -238,7 +328,7 @@ public ManagedInstanceUpdate withVCores(Integer vCores) { } /** - * Get the maximum storage size in GB. + * Get storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. * * @return the storageSizeInGB value */ @@ -247,7 +337,7 @@ public Integer storageSizeInGB() { } /** - * Set the maximum storage size in GB. + * Set storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. * * @param storageSizeInGB the storageSizeInGB value to set * @return the ManagedInstanceUpdate object itself. @@ -306,6 +396,136 @@ public ManagedInstanceUpdate withDnsZonePartner(String dnsZonePartner) { return this; } + /** + * Get whether or not the public data endpoint is enabled. + * + * @return the publicDataEndpointEnabled value + */ + public Boolean publicDataEndpointEnabled() { + return this.publicDataEndpointEnabled; + } + + /** + * Set whether or not the public data endpoint is enabled. + * + * @param publicDataEndpointEnabled the publicDataEndpointEnabled value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + this.publicDataEndpointEnabled = publicDataEndpointEnabled; + return this; + } + + /** + * Get the resource identifier of the source managed instance associated with create operation of this instance. + * + * @return the sourceManagedInstanceId value + */ + public String sourceManagedInstanceId() { + return this.sourceManagedInstanceId; + } + + /** + * Set the resource identifier of the source managed instance associated with create operation of this instance. + * + * @param sourceManagedInstanceId the sourceManagedInstanceId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withSourceManagedInstanceId(String sourceManagedInstanceId) { + this.sourceManagedInstanceId = sourceManagedInstanceId; + return this; + } + + /** + * Get specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @return the proxyOverride value + */ + public ManagedInstanceProxyOverride proxyOverride() { + return this.proxyOverride; + } + + /** + * Set connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @param proxyOverride the proxyOverride value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + this.proxyOverride = proxyOverride; + return this; + } + + /** + * Get id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @return the timezoneId value + */ + public String timezoneId() { + return this.timezoneId; + } + + /** + * Set id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @param timezoneId the timezoneId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withTimezoneId(String timezoneId) { + this.timezoneId = timezoneId; + return this; + } + + /** + * Get the Id of the instance pool this managed server belongs to. + * + * @return the instancePoolId value + */ + public String instancePoolId() { + return this.instancePoolId; + } + + /** + * Set the Id of the instance pool this managed server belongs to. + * + * @param instancePoolId the instancePoolId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withInstancePoolId(String instancePoolId) { + this.instancePoolId = instancePoolId; + return this; + } + /** * Get resource tags. * diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedServerCreateMode.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedServerCreateMode.java new file mode 100644 index 000000000000..69456304a58d --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedServerCreateMode.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.sql.v2015_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedServerCreateMode. + */ +public final class ManagedServerCreateMode extends ExpandableStringEnum { + /** Static value Default for ManagedServerCreateMode. */ + public static final ManagedServerCreateMode DEFAULT = fromString("Default"); + + /** Static value PointInTimeRestore for ManagedServerCreateMode. */ + public static final ManagedServerCreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + + /** + * Creates or finds a ManagedServerCreateMode from its string representation. + * @param name a name to look for + * @return the corresponding ManagedServerCreateMode + */ + @JsonCreator + public static ManagedServerCreateMode fromString(String name) { + return fromString(name, ManagedServerCreateMode.class); + } + + /** + * @return known ManagedServerCreateMode values + */ + public static Collection values() { + return values(ManagedServerCreateMode.class); + } +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/RecommendedActionStateInfo.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/RecommendedActionStateInfo.java index 15422cce9fb1..4cef42e50543 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/RecommendedActionStateInfo.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/RecommendedActionStateInfo.java @@ -28,7 +28,7 @@ public class RecommendedActionStateInfo { * improvement so recommended action is queued for revert or user has * manually reverted. Reverting -> changes made while applying * recommended action are being reverted on the user database. Reverted - * -> succesfully reverted the changes made by recommended action on + * -> successfully reverted the changes made by recommended action on * user database. Ignored -> user explicitly ignored/discarded the * recommended action. Possible values include: 'Active', 'Pending', * 'Executing', 'Verifying', 'PendingRevert', 'RevertCancelled', @@ -40,7 +40,7 @@ public class RecommendedActionStateInfo { /** * Gets who initiated the execution of this recommended action. Possible - * Value are: User -> When user explicity notified system to apply + * Value are: User -> When user explicitly notified system to apply * the recommended action. System -> When auto-execute status of this * advisor was set to 'Enabled', in which case the system applied it. * Possible values include: 'User', 'System'. @@ -55,7 +55,7 @@ public class RecommendedActionStateInfo { private DateTime lastModified; /** - * Get current state the recommended action is in. Some commonly used states are: Active -> recommended action is active and no action has been taken yet. Pending -> recommended action is approved for and is awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action was applied and is being verified of its usefulness by the system. Success -> recommended action was applied and improvement found during verification. Pending Revert -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted -> succesfully reverted the changes made by recommended action on user database. Ignored -> user explicitly ignored/discarded the recommended action. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error'. + * Get current state the recommended action is in. Some commonly used states are: Active -> recommended action is active and no action has been taken yet. Pending -> recommended action is approved for and is awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action was applied and is being verified of its usefulness by the system. Success -> recommended action was applied and improvement found during verification. Pending Revert -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted -> successfully reverted the changes made by recommended action on user database. Ignored -> user explicitly ignored/discarded the recommended action. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error'. * * @return the currentValue value */ @@ -64,7 +64,7 @@ public RecommendedActionCurrentState currentValue() { } /** - * Set current state the recommended action is in. Some commonly used states are: Active -> recommended action is active and no action has been taken yet. Pending -> recommended action is approved for and is awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action was applied and is being verified of its usefulness by the system. Success -> recommended action was applied and improvement found during verification. Pending Revert -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted -> succesfully reverted the changes made by recommended action on user database. Ignored -> user explicitly ignored/discarded the recommended action. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error'. + * Set current state the recommended action is in. Some commonly used states are: Active -> recommended action is active and no action has been taken yet. Pending -> recommended action is approved for and is awaiting execution. Executing -> recommended action is being applied on the user database. Verifying -> recommended action was applied and is being verified of its usefulness by the system. Success -> recommended action was applied and improvement found during verification. Pending Revert -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting -> changes made while applying recommended action are being reverted on the user database. Reverted -> successfully reverted the changes made by recommended action on user database. Ignored -> user explicitly ignored/discarded the recommended action. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error'. * * @param currentValue the currentValue value to set * @return the RecommendedActionStateInfo object itself. @@ -75,7 +75,7 @@ public RecommendedActionStateInfo withCurrentValue(RecommendedActionCurrentState } /** - * Get gets who initiated the execution of this recommended action. Possible Value are: User -> When user explicity notified system to apply the recommended action. System -> When auto-execute status of this advisor was set to 'Enabled', in which case the system applied it. Possible values include: 'User', 'System'. + * Get gets who initiated the execution of this recommended action. Possible Value are: User -> When user explicitly notified system to apply the recommended action. System -> When auto-execute status of this advisor was set to 'Enabled', in which case the system applied it. Possible values include: 'User', 'System'. * * @return the actionInitiatedBy value */ diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualCluster.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualCluster.java new file mode 100644 index 000000000000..986eb161911e --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualCluster.java @@ -0,0 +1,65 @@ +/** + * 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.sql.v2015_05_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.sql.v2015_05_01_preview.implementation.SqlManager; +import java.util.List; +import com.microsoft.azure.management.sql.v2015_05_01_preview.implementation.VirtualClusterInner; + +/** + * Type representing VirtualCluster. + */ +public interface VirtualCluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the childResources value. + */ + List childResources(); + + /** + * @return the family value. + */ + String family(); + + /** + * @return the subnetId value. + */ + String subnetId(); + + /** + * The template for a VirtualCluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithFamily { + } + + /** + * Grouping of VirtualCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualcluster update allowing to specify Family. + */ + interface WithFamily { + /** + * Specifies family. + * @param family If the service has different generations of hardware, for the same SKU, then that can be captured here + * @return the next update stage + */ + Update withFamily(String family); + } + + } +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusterUpdate.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusterUpdate.java new file mode 100644 index 000000000000..435181c8a70e --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusterUpdate.java @@ -0,0 +1,104 @@ +/** + * 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.sql.v2015_05_01_preview; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * An update request for an Azure SQL Database virtual cluster. + */ +@JsonFlatten +public class VirtualClusterUpdate { + /** + * Subnet resource ID for the virtual cluster. + */ + @JsonProperty(value = "properties.subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "properties.family") + private String family; + + /** + * List of resources in this virtual cluster. + */ + @JsonProperty(value = "properties.childResources", access = JsonProperty.Access.WRITE_ONLY) + private List childResources; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get subnet resource ID for the virtual cluster. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Get if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @param family the family value to set + * @return the VirtualClusterUpdate object itself. + */ + public VirtualClusterUpdate withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get list of resources in this virtual cluster. + * + * @return the childResources value + */ + public List childResources() { + return this.childResources; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the VirtualClusterUpdate object itself. + */ + public VirtualClusterUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusters.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusters.java new file mode 100644 index 000000000000..f440a1321724 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/VirtualClusters.java @@ -0,0 +1,24 @@ +/** + * 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.sql.v2015_05_01_preview; + +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.sql.v2015_05_01_preview.implementation.VirtualClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualClusters. + */ +public interface VirtualClusters extends SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/AdvisorInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/AdvisorInner.java index 2663f0329461..99309897e8da 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/AdvisorInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/AdvisorInner.java @@ -18,7 +18,7 @@ import com.microsoft.azure.ProxyResource; /** - * Database, Server or Elatic Pool Advisor. + * Database, Server or Elastic Pool Advisor. */ @JsonFlatten public class AdvisorInner extends ProxyResource { @@ -53,8 +53,8 @@ public class AdvisorInner extends ProxyResource { /** * Gets the resource from which current value of auto-execute status is - * inherited. Auto-execute status can be set on (and inhertied from) - * different levels in the resource heirarchy. Possible values are + * inherited. Auto-execute status can be set on (and inherited from) + * different levels in the resource hierarchy. Possible values are * 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when * status is not explicitly set on any level). Possible values include: * 'Default', 'Subscription', 'Server', 'ElasticPool', 'Database'. @@ -132,7 +132,7 @@ public AdvisorInner withAutoExecuteStatus(AutoExecuteStatus autoExecuteStatus) { } /** - * Get gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inhertied from) different levels in the resource heirarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Possible values include: 'Default', 'Subscription', 'Server', 'ElasticPool', 'Database'. + * Get gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inherited from) different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Possible values include: 'Default', 'Subscription', 'Server', 'ElasticPool', 'Database'. * * @return the autoExecuteStatusInheritedFrom value */ diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPolicyInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPolicyInner.java index 509ea501d220..4bda8fd51a09 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPolicyInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPolicyInner.java @@ -148,8 +148,8 @@ public class DatabaseBlobAuditingPolicyInner extends ProxyResource { /** * Specifies whether audit events are sent to Azure Monitor. - * In order to send the events to Azure Monitor, specify 'State' as - * 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. + * In order to send the events to Azure Monitor, specify 'state' as + * 'Enabled' and 'isAzureMonitorTargetEnabled' as true. * * When using REST API to configure auditing, Diagnostic Settings with * 'SQLSecurityAuditEvents' diagnostic logs category on the database should @@ -408,7 +408,7 @@ public DatabaseBlobAuditingPolicyInner withIsStorageSecondaryKeyInUse(Boolean is /** * Get specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}. Diagnostic Settings URI format: @@ -424,7 +424,7 @@ public Boolean isAzureMonitorTargetEnabled() { /** * Set specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as {databaseName}. Diagnostic Settings URI format: diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java index 1500a0ca9852..a8518ba8dfc7 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java @@ -12,8 +12,12 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstance; import rx.Observable; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceUpdate; +import org.joda.time.DateTime; import com.microsoft.azure.management.sql.v2015_05_01_preview.ResourceIdentity; import com.microsoft.azure.management.sql.v2015_05_01_preview.Sku; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedServerCreateMode; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; import rx.functions.Func1; class ManagedInstanceImpl extends GroupableResourceCoreImpl implements ManagedInstance, ManagedInstance.Definition, ManagedInstance.Update { @@ -102,15 +106,45 @@ public ResourceIdentity identity() { } @Override - public String licenseType() { + public String instancePoolId() { + return this.inner().instancePoolId(); + } + + @Override + public ManagedInstanceLicenseType licenseType() { return this.inner().licenseType(); } + @Override + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.inner().managedInstanceCreateMode(); + } + + @Override + public ManagedInstanceProxyOverride proxyOverride() { + return this.inner().proxyOverride(); + } + + @Override + public Boolean publicDataEndpointEnabled() { + return this.inner().publicDataEndpointEnabled(); + } + + @Override + public DateTime restorePointInTime() { + return this.inner().restorePointInTime(); + } + @Override public Sku sku() { return this.inner().sku(); } + @Override + public String sourceManagedInstanceId() { + return this.inner().sourceManagedInstanceId(); + } + @Override public String state() { return this.inner().state(); @@ -126,6 +160,11 @@ public String subnetId() { return this.inner().subnetId(); } + @Override + public String timezoneId() { + return this.inner().timezoneId(); + } + @Override public Integer vCores() { return this.inner().vCores(); @@ -178,7 +217,17 @@ public ManagedInstanceImpl withDnsZonePartner(String dnsZonePartner) { } @Override - public ManagedInstanceImpl withLicenseType(String licenseType) { + public ManagedInstanceImpl withInstancePoolId(String instancePoolId) { + if (isInCreateMode()) { + this.inner().withInstancePoolId(instancePoolId); + } else { + this.updateParameter.withInstancePoolId(instancePoolId); + } + return this; + } + + @Override + public ManagedInstanceImpl withLicenseType(ManagedInstanceLicenseType licenseType) { if (isInCreateMode()) { this.inner().withLicenseType(licenseType); } else { @@ -187,6 +236,46 @@ public ManagedInstanceImpl withLicenseType(String licenseType) { return this; } + @Override + public ManagedInstanceImpl withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + if (isInCreateMode()) { + this.inner().withManagedInstanceCreateMode(managedInstanceCreateMode); + } else { + this.updateParameter.withManagedInstanceCreateMode(managedInstanceCreateMode); + } + return this; + } + + @Override + public ManagedInstanceImpl withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + if (isInCreateMode()) { + this.inner().withProxyOverride(proxyOverride); + } else { + this.updateParameter.withProxyOverride(proxyOverride); + } + return this; + } + + @Override + public ManagedInstanceImpl withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + if (isInCreateMode()) { + this.inner().withPublicDataEndpointEnabled(publicDataEndpointEnabled); + } else { + this.updateParameter.withPublicDataEndpointEnabled(publicDataEndpointEnabled); + } + return this; + } + + @Override + public ManagedInstanceImpl withRestorePointInTime(DateTime restorePointInTime) { + if (isInCreateMode()) { + this.inner().withRestorePointInTime(restorePointInTime); + } else { + this.updateParameter.withRestorePointInTime(restorePointInTime); + } + return this; + } + @Override public ManagedInstanceImpl withSku(Sku sku) { if (isInCreateMode()) { @@ -197,6 +286,16 @@ public ManagedInstanceImpl withSku(Sku sku) { return this; } + @Override + public ManagedInstanceImpl withSourceManagedInstanceId(String sourceManagedInstanceId) { + if (isInCreateMode()) { + this.inner().withSourceManagedInstanceId(sourceManagedInstanceId); + } else { + this.updateParameter.withSourceManagedInstanceId(sourceManagedInstanceId); + } + return this; + } + @Override public ManagedInstanceImpl withStorageSizeInGB(Integer storageSizeInGB) { if (isInCreateMode()) { @@ -217,6 +316,16 @@ public ManagedInstanceImpl withSubnetId(String subnetId) { return this; } + @Override + public ManagedInstanceImpl withTimezoneId(String timezoneId) { + if (isInCreateMode()) { + this.inner().withTimezoneId(timezoneId); + } else { + this.updateParameter.withTimezoneId(timezoneId); + } + return this; + } + @Override public ManagedInstanceImpl withVCores(Integer vCores) { if (isInCreateMode()) { diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java index 2fc537c23f6f..c1ce6158e575 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java @@ -10,6 +10,10 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ResourceIdentity; import com.microsoft.azure.management.sql.v2015_05_01_preview.Sku; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedServerCreateMode; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -26,11 +30,24 @@ public class ManagedInstanceInner extends Resource { private ResourceIdentity identity; /** - * Managed instance sku. + * Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, + * BC_Gen4, BC_Gen5. */ @JsonProperty(value = "sku") private Sku sku; + /** + * Specifies the mode of database creation. + * + * Default: Regular instance creation. + * + * Restore: Creates an instance by restoring a set of backups to specific + * point in time. RestorePointInTime and SourceManagedInstanceId must be + * specified. Possible values include: 'Default', 'PointInTimeRestore'. + */ + @JsonProperty(value = "properties.managedInstanceCreateMode") + private ManagedServerCreateMode managedInstanceCreateMode; + /** * The fully qualified domain name of the managed instance. */ @@ -65,19 +82,23 @@ public class ManagedInstanceInner extends Resource { private String state; /** - * The license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * The license type. Possible values are 'LicenseIncluded' (regular price + * inclusive of a new SQL license) and 'BasePrice' (discounted AHB price + * for bringing your own SQL licenses). Possible values include: + * 'LicenseIncluded', 'BasePrice'. */ @JsonProperty(value = "properties.licenseType") - private String licenseType; + private ManagedInstanceLicenseType licenseType; /** - * The number of VCores. + * The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. */ @JsonProperty(value = "properties.vCores") private Integer vCores; /** - * The maximum storage size in GB. + * Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments + * of 32 GB allowed only. */ @JsonProperty(value = "properties.storageSizeInGB") private Integer storageSizeInGB; @@ -101,6 +122,55 @@ public class ManagedInstanceInner extends Resource { @JsonProperty(value = "properties.dnsZonePartner") private String dnsZonePartner; + /** + * Whether or not the public data endpoint is enabled. + */ + @JsonProperty(value = "properties.publicDataEndpointEnabled") + private Boolean publicDataEndpointEnabled; + + /** + * The resource identifier of the source managed instance associated with + * create operation of this instance. + */ + @JsonProperty(value = "properties.sourceManagedInstanceId") + private String sourceManagedInstanceId; + + /** + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. + */ + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; + + /** + * Connection type used for connecting to the instance. Possible values + * include: 'Proxy', 'Redirect', 'Default'. + */ + @JsonProperty(value = "properties.proxyOverride") + private ManagedInstanceProxyOverride proxyOverride; + + /** + * Id of the timezone. Allowed values are timezones supported by Windows. + * Windows keeps details on supported timezones, including the id, in + * registry under + * KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time + * Zones. + * You can get those registry values via SQL Server by querying SELECT name + * AS timezone_id FROM sys.time_zone_info. + * List of Ids can also be obtained by executing + * [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + * An example of valid timezone id is "Pacific Standard Time" or "W. Europe + * Standard Time". + */ + @JsonProperty(value = "properties.timezoneId") + private String timezoneId; + + /** + * The Id of the instance pool this managed server belongs to. + */ + @JsonProperty(value = "properties.instancePoolId") + private String instancePoolId; + /** * Get the Azure Active Directory identity of the managed instance. * @@ -122,7 +192,7 @@ public ManagedInstanceInner withIdentity(ResourceIdentity identity) { } /** - * Get managed instance sku. + * Get managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5. * * @return the sku value */ @@ -131,7 +201,7 @@ public Sku sku() { } /** - * Set managed instance sku. + * Set managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5. * * @param sku the sku value to set * @return the ManagedInstanceInner object itself. @@ -141,6 +211,30 @@ public ManagedInstanceInner withSku(Sku sku) { return this; } + /** + * Get specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @return the managedInstanceCreateMode value + */ + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.managedInstanceCreateMode; + } + + /** + * Set specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @param managedInstanceCreateMode the managedInstanceCreateMode value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + this.managedInstanceCreateMode = managedInstanceCreateMode; + return this; + } + /** * Get the fully qualified domain name of the managed instance. * @@ -220,27 +314,27 @@ public String state() { } /** - * Get the license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * Get the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. * * @return the licenseType value */ - public String licenseType() { + public ManagedInstanceLicenseType licenseType() { return this.licenseType; } /** - * Set the license type. Possible values are 'LicenseIncluded' and 'BasePrice'. + * Set the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. * * @param licenseType the licenseType value to set * @return the ManagedInstanceInner object itself. */ - public ManagedInstanceInner withLicenseType(String licenseType) { + public ManagedInstanceInner withLicenseType(ManagedInstanceLicenseType licenseType) { this.licenseType = licenseType; return this; } /** - * Get the number of VCores. + * Get the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. * * @return the vCores value */ @@ -249,7 +343,7 @@ public Integer vCores() { } /** - * Set the number of VCores. + * Set the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. * * @param vCores the vCores value to set * @return the ManagedInstanceInner object itself. @@ -260,7 +354,7 @@ public ManagedInstanceInner withVCores(Integer vCores) { } /** - * Get the maximum storage size in GB. + * Get storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. * * @return the storageSizeInGB value */ @@ -269,7 +363,7 @@ public Integer storageSizeInGB() { } /** - * Set the maximum storage size in GB. + * Set storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. * * @param storageSizeInGB the storageSizeInGB value to set * @return the ManagedInstanceInner object itself. @@ -328,4 +422,134 @@ public ManagedInstanceInner withDnsZonePartner(String dnsZonePartner) { return this; } + /** + * Get whether or not the public data endpoint is enabled. + * + * @return the publicDataEndpointEnabled value + */ + public Boolean publicDataEndpointEnabled() { + return this.publicDataEndpointEnabled; + } + + /** + * Set whether or not the public data endpoint is enabled. + * + * @param publicDataEndpointEnabled the publicDataEndpointEnabled value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + this.publicDataEndpointEnabled = publicDataEndpointEnabled; + return this; + } + + /** + * Get the resource identifier of the source managed instance associated with create operation of this instance. + * + * @return the sourceManagedInstanceId value + */ + public String sourceManagedInstanceId() { + return this.sourceManagedInstanceId; + } + + /** + * Set the resource identifier of the source managed instance associated with create operation of this instance. + * + * @param sourceManagedInstanceId the sourceManagedInstanceId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withSourceManagedInstanceId(String sourceManagedInstanceId) { + this.sourceManagedInstanceId = sourceManagedInstanceId; + return this; + } + + /** + * Get specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @return the proxyOverride value + */ + public ManagedInstanceProxyOverride proxyOverride() { + return this.proxyOverride; + } + + /** + * Set connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @param proxyOverride the proxyOverride value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + this.proxyOverride = proxyOverride; + return this; + } + + /** + * Get id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @return the timezoneId value + */ + public String timezoneId() { + return this.timezoneId; + } + + /** + * Set id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @param timezoneId the timezoneId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withTimezoneId(String timezoneId) { + this.timezoneId = timezoneId; + return this; + } + + /** + * Get the Id of the instance pool this managed server belongs to. + * + * @return the instancePoolId value + */ + public String instancePoolId() { + return this.instancePoolId; + } + + /** + * Set the Id of the instance pool this managed server belongs to. + * + * @param instancePoolId the instancePoolId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withInstancePoolId(String instancePoolId) { + this.instancePoolId = instancePoolId; + return this; + } + } diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java index 2ecb94ce48b0..4118fa516c9c 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java @@ -66,10 +66,6 @@ public ManagedInstancesInner(Retrofit retrofit, SqlManagementClientImpl client) * used by Retrofit to perform actually REST calls. */ interface ManagedInstancesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances") - 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.sql.v2015_05_01_preview.ManagedInstances listByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances") 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); @@ -102,121 +98,18 @@ interface ManagedInstancesService { @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceUpdate 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.sql.v2015_05_01_preview.ManagedInstances 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.sql.v2015_05_01_preview.ManagedInstances list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances") + 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.sql.v2015_05_01_preview.ManagedInstances listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - } - - /** - * Gets a list of all managed instances in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<ManagedInstanceInner> 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 all managed instances in the subscription. - * - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Gets a list of all managed instances in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> object - */ - public Observable> listAsync() { - return listWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Gets a list of all managed instances in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> 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 all managed instances in the subscription. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ManagedInstanceInner> 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."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), this.client.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); - } - } - }); - } + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - 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); } /** @@ -923,14 +816,13 @@ private ServiceResponse beginUpdateDelegate(Response listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -942,15 +834,13 @@ public Page nextPage(String nextPageLink) { /** * Gets a list of all managed instances in the subscription. * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listNextSinglePageAsync(nextPageLink), + listSinglePageAsync(), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -963,12 +853,11 @@ public Observable>> call(String nextP /** * Gets a list of all managed instances in the subscription. * - * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<ManagedInstanceInner> object */ - public Observable> listNextAsync(final String nextPageLink) { - return listNextWithServiceResponseAsync(nextPageLink) + public Observable> listAsync() { + return listWithServiceResponseAsync() .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -980,12 +869,11 @@ public Page call(ServiceResponse>> listNextWithServiceResponseAsync(final String nextPageLink) { - return listNextSinglePageAsync(nextPageLink) + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -1001,21 +889,22 @@ public Observable>> call(ServiceRespo /** * Gets a list of all managed instances in the subscription. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ManagedInstanceInner> 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."); + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - String nextUrl = String.format("%s", nextPageLink); - return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -1024,7 +913,7 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + 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) @@ -1142,4 +1031,115 @@ private ServiceResponse> listByResourceGroupNextD .build(response); } + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> 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 all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> 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 all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> 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 all managed instances in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManagementClientImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManagementClientImpl.java index b590471e7ff5..507e7b7b6e1a 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManagementClientImpl.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManagementClientImpl.java @@ -340,6 +340,19 @@ public SubscriptionUsagesInner subscriptionUsages() { return this.subscriptionUsages; } + /** + * The VirtualClustersInner object to access its operations. + */ + private VirtualClustersInner virtualClusters; + + /** + * Gets the VirtualClustersInner object to access its operations. + * @return the VirtualClustersInner object. + */ + public VirtualClustersInner virtualClusters() { + return this.virtualClusters; + } + /** * The VirtualNetworkRulesInner object to access its operations. */ @@ -404,6 +417,7 @@ protected void initialize() { this.syncGroups = new SyncGroupsInner(restClient().retrofit(), this); this.syncMembers = new SyncMembersInner(restClient().retrofit(), this); this.subscriptionUsages = new SubscriptionUsagesInner(restClient().retrofit(), this); + this.virtualClusters = new VirtualClustersInner(restClient().retrofit(), this); this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManager.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManager.java index 7fa51ffb3251..04f21c8a2b56 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManager.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SqlManager.java @@ -32,6 +32,7 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.SyncGroups; import com.microsoft.azure.management.sql.v2015_05_01_preview.SyncMembers; import com.microsoft.azure.management.sql.v2015_05_01_preview.SubscriptionUsages; +import com.microsoft.azure.management.sql.v2015_05_01_preview.VirtualClusters; import com.microsoft.azure.management.sql.v2015_05_01_preview.VirtualNetworkRules; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -56,6 +57,7 @@ public final class SqlManager extends ManagerCore implements VirtualCluster, VirtualCluster.Update { + private VirtualClusterUpdate updateParameter; + VirtualClusterImpl(String name, VirtualClusterInner inner, SqlManager manager) { + super(name, inner, manager); + this.updateParameter = new VirtualClusterUpdate(); + } + + @Override + public Observable createResourceAsync() { + VirtualClustersInner client = this.manager().inner().virtualClusters(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + VirtualClustersInner client = this.manager().inner().virtualClusters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public VirtualClusterInner call(VirtualClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualClustersInner client = this.manager().inner().virtualClusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VirtualClusterUpdate(); + } + + @Override + public List childResources() { + return this.inner().childResources(); + } + + @Override + public String family() { + return this.inner().family(); + } + + @Override + public String subnetId() { + return this.inner().subnetId(); + } + + @Override + public VirtualClusterImpl withFamily(String family) { + this.updateParameter.withFamily(family); + return this; + } + +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClusterInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClusterInner.java new file mode 100644 index 000000000000..169c61cbd7a6 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClusterInner.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2015_05_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An Azure SQL virtual cluster. + */ +@JsonFlatten +public class VirtualClusterInner extends Resource { + /** + * Subnet resource ID for the virtual cluster. + */ + @JsonProperty(value = "properties.subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "properties.family") + private String family; + + /** + * List of resources in this virtual cluster. + */ + @JsonProperty(value = "properties.childResources", access = JsonProperty.Access.WRITE_ONLY) + private List childResources; + + /** + * Get subnet resource ID for the virtual cluster. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Get if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @param family the family value to set + * @return the VirtualClusterInner object itself. + */ + public VirtualClusterInner withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get list of resources in this virtual cluster. + * + * @return the childResources value + */ + public List childResources() { + return this.childResources; + } + +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersImpl.java new file mode 100644 index 000000000000..3ae24cca4746 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersImpl.java @@ -0,0 +1,133 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.sql.v2015_05_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.sql.v2015_05_01_preview.VirtualClusters; +import com.microsoft.azure.management.sql.v2015_05_01_preview.VirtualCluster; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class VirtualClustersImpl extends GroupableResourcesCoreImpl implements VirtualClusters { + protected VirtualClustersImpl(SqlManager manager) { + super(manager.inner().virtualClusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + VirtualClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualCluster call(VirtualClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualCluster call(VirtualClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected VirtualClusterImpl wrapModel(VirtualClusterInner inner) { + return new VirtualClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualClusterImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersInner.java new file mode 100644 index 000000000000..609b331f3085 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/VirtualClustersInner.java @@ -0,0 +1,963 @@ +/** + * 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.sql.v2015_05_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.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.management.sql.v2015_05_01_preview.VirtualClusterUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.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 VirtualClusters. + */ +public class VirtualClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualClustersService service; + /** The service client containing this operation class. */ + private SqlManagementClientImpl client; + + /** + * Initializes an instance of VirtualClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualClustersInner(Retrofit retrofit, SqlManagementClientImpl client) { + this.service = retrofit.create(VirtualClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualClusters to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.VirtualClusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters") + 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.sql.v2015_05_01_preview.VirtualClusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters") + 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.sql.v2015_05_01_preview.VirtualClusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("virtualClusterName") String virtualClusterName, @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.sql.v2015_05_01_preview.VirtualClusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualClusterName") String virtualClusterName, @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.sql.v2015_05_01_preview.VirtualClusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("virtualClusterName") String virtualClusterName, @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.sql.v2015_05_01_preview.VirtualClusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("virtualClusterName") String virtualClusterName, @Path("subscriptionId") String subscriptionId, @Body VirtualClusterUpdate 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.sql.v2015_05_01_preview.VirtualClusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("virtualClusterName") String virtualClusterName, @Path("subscriptionId") String subscriptionId, @Body VirtualClusterUpdate 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.sql.v2015_05_01_preview.VirtualClusters 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.sql.v2015_05_01_preview.VirtualClusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of all virtualClusters in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualClusterInner> 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 all virtualClusters in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all virtualClusters in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all virtualClusters in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 all virtualClusters in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualClusterInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.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); + } + + /** + * Gets a list of virtual clusters in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @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<VirtualClusterInner> 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 virtual clusters in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @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 virtual clusters in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualClusterInner> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.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 virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 VirtualClusterInner object if successful. + */ + public VirtualClusterInner getByResourceGroup(String resourceGroupName, String virtualClusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualClusterName).toBlocking().single().body(); + } + + /** + * Gets a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 virtualClusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualClusterName), serviceCallback); + } + + /** + * Gets a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualClusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualClusterName).map(new Func1, VirtualClusterInner>() { + @Override + public VirtualClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualClusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualClusterName == null) { + throw new IllegalArgumentException("Parameter virtualClusterName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, virtualClusterName, this.client.subscriptionId(), this.client.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 a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 virtualClusterName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualClusterName).toBlocking().last().body(); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 virtualClusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualClusterName), serviceCallback); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualClusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualClusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualClusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualClusterName == null) { + throw new IllegalArgumentException("Parameter virtualClusterName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, virtualClusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 virtualClusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualClusterName).toBlocking().single().body(); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @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 virtualClusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualClusterName), serviceCallback); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualClusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualClusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualClusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualClusterName == null) { + throw new IllegalArgumentException("Parameter virtualClusterName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, virtualClusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @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 VirtualClusterInner object if successful. + */ + public VirtualClusterInner update(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters).toBlocking().last().body(); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @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 virtualClusterName, VirtualClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters), serviceCallback); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters).map(new Func1, VirtualClusterInner>() { + @Override + public VirtualClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualClusterName == null) { + throw new IllegalArgumentException("Parameter virtualClusterName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, virtualClusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @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 VirtualClusterInner object if successful. + */ + public VirtualClusterInner beginUpdate(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters).toBlocking().single().body(); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @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 virtualClusterName, VirtualClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters), serviceCallback); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualClusterName, parameters).map(new Func1, VirtualClusterInner>() { + @Override + public VirtualClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a virtual cluster. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param virtualClusterName The name of the virtual cluster. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String virtualClusterName, VirtualClusterUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (virtualClusterName == null) { + throw new IllegalArgumentException("Parameter virtualClusterName 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, virtualClusterName, this.client.subscriptionId(), parameters, this.client.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); + } + + /** + * Gets a list of all virtualClusters in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualClusterInner> 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 all virtualClusters in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all virtualClusters in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 all virtualClusters in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 all virtualClusters in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of virtual clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualClusterInner> 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 virtual clusters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualClusterInner> 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); + } + +}