diff --git a/sdk/sql/mgmt-v2017_10_01_preview/pom.xml b/sdk/sql/mgmt-v2017_10_01_preview/pom.xml index 388ceb2c097b5..0ca5efd11d1be 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/pom.xml +++ b/sdk/sql/mgmt-v2017_10_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-sql 1.0.0-beta @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Database.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Database.java index 966ec7467b22d..697e387b59d21 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Database.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Database.java @@ -25,6 +25,11 @@ * Type representing Database. */ public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoPauseDelay value. + */ + Integer autoPauseDelay(); + /** * @return the catalogCollation value. */ @@ -120,11 +125,26 @@ public interface Database extends HasInner, Indexable, Refreshabl */ Long maxSizeBytes(); + /** + * @return the minCapacity value. + */ + Double minCapacity(); + /** * @return the name value. */ String name(); + /** + * @return the pausedDate value. + */ + DateTime pausedDate(); + + /** + * @return the readReplicaCount value. + */ + Integer readReplicaCount(); + /** * @return the readScale value. */ @@ -155,6 +175,11 @@ public interface Database extends HasInner, Indexable, Refreshabl */ DateTime restorePointInTime(); + /** + * @return the resumedDate value. + */ + DateTime resumedDate(); + /** * @return the sampleName value. */ @@ -236,6 +261,18 @@ interface WithLocation { WithCreate withLocation(String location); } + /** + * The stage of the database definition allowing to specify AutoPauseDelay. + */ + interface WithAutoPauseDelay { + /** + * Specifies autoPauseDelay. + * @param autoPauseDelay Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled + * @return the next definition stage + */ + WithCreate withAutoPauseDelay(Integer autoPauseDelay); + } + /** * The stage of the database definition allowing to specify CatalogCollation. */ @@ -298,7 +335,7 @@ interface WithElasticPoolId { interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType The license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice' + * @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice' * @return the next definition stage */ WithCreate withLicenseType(DatabaseLicenseType licenseType); @@ -328,13 +365,37 @@ interface WithMaxSizeBytes { WithCreate withMaxSizeBytes(Long maxSizeBytes); } + /** + * The stage of the database definition allowing to specify MinCapacity. + */ + interface WithMinCapacity { + /** + * Specifies minCapacity. + * @param minCapacity Minimal capacity that database will always have allocated, if not paused + * @return the next definition stage + */ + WithCreate withMinCapacity(Double minCapacity); + } + + /** + * The stage of the database definition allowing to specify ReadReplicaCount. + */ + interface WithReadReplicaCount { + /** + * Specifies readReplicaCount. + * @param readReplicaCount The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases + * @return the next definition stage + */ + WithCreate withReadReplicaCount(Integer readReplicaCount); + } + /** * The stage of the database definition allowing to specify ReadScale. */ interface WithReadScale { /** * Specifies readScale. - * @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled' + * @param readScale If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled' * @return the next definition stage */ WithCreate withReadScale(DatabaseReadScale readScale); @@ -406,7 +467,14 @@ interface WithSampleName { interface WithSku { /** * Specifies sku. - * @param sku The name and tier of the SKU + * @param sku The database SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l <location> -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location <location> + ```` * @return the next definition stage */ WithCreate withSku(Sku sku); @@ -465,19 +533,31 @@ interface WithZoneRedundant { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, DefinitionStages.WithCatalogCollation, DefinitionStages.WithCollation, DefinitionStages.WithCreateMode, DefinitionStages.WithElasticPoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithLongTermRetentionBackupResourceId, DefinitionStages.WithMaxSizeBytes, DefinitionStages.WithReadScale, DefinitionStages.WithRecoverableDatabaseId, DefinitionStages.WithRecoveryServicesRecoveryPointId, DefinitionStages.WithRestorableDroppedDatabaseId, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSampleName, DefinitionStages.WithSku, DefinitionStages.WithSourceDatabaseDeletionDate, DefinitionStages.WithSourceDatabaseId, DefinitionStages.WithTags, DefinitionStages.WithZoneRedundant { + interface WithCreate extends Creatable, DefinitionStages.WithAutoPauseDelay, DefinitionStages.WithCatalogCollation, DefinitionStages.WithCollation, DefinitionStages.WithCreateMode, DefinitionStages.WithElasticPoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithLongTermRetentionBackupResourceId, DefinitionStages.WithMaxSizeBytes, DefinitionStages.WithMinCapacity, DefinitionStages.WithReadReplicaCount, DefinitionStages.WithReadScale, DefinitionStages.WithRecoverableDatabaseId, DefinitionStages.WithRecoveryServicesRecoveryPointId, DefinitionStages.WithRestorableDroppedDatabaseId, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSampleName, DefinitionStages.WithSku, DefinitionStages.WithSourceDatabaseDeletionDate, DefinitionStages.WithSourceDatabaseId, DefinitionStages.WithTags, DefinitionStages.WithZoneRedundant { } } /** * The template for a Database update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithCatalogCollation, UpdateStages.WithCollation, UpdateStages.WithCreateMode, UpdateStages.WithElasticPoolId, UpdateStages.WithLicenseType, UpdateStages.WithLongTermRetentionBackupResourceId, UpdateStages.WithMaxSizeBytes, UpdateStages.WithReadScale, UpdateStages.WithRecoverableDatabaseId, UpdateStages.WithRecoveryServicesRecoveryPointId, UpdateStages.WithRestorableDroppedDatabaseId, UpdateStages.WithRestorePointInTime, UpdateStages.WithSampleName, UpdateStages.WithSku, UpdateStages.WithSourceDatabaseDeletionDate, UpdateStages.WithSourceDatabaseId, UpdateStages.WithTags, UpdateStages.WithZoneRedundant { + interface Update extends Appliable, UpdateStages.WithAutoPauseDelay, UpdateStages.WithCatalogCollation, UpdateStages.WithCollation, UpdateStages.WithCreateMode, UpdateStages.WithElasticPoolId, UpdateStages.WithLicenseType, UpdateStages.WithLongTermRetentionBackupResourceId, UpdateStages.WithMaxSizeBytes, UpdateStages.WithMinCapacity, UpdateStages.WithReadReplicaCount, UpdateStages.WithReadScale, UpdateStages.WithRecoverableDatabaseId, UpdateStages.WithRecoveryServicesRecoveryPointId, UpdateStages.WithRestorableDroppedDatabaseId, UpdateStages.WithRestorePointInTime, UpdateStages.WithSampleName, UpdateStages.WithSku, UpdateStages.WithSourceDatabaseDeletionDate, UpdateStages.WithSourceDatabaseId, UpdateStages.WithTags, UpdateStages.WithZoneRedundant { } /** * Grouping of Database update stages. */ interface UpdateStages { + /** + * The stage of the database update allowing to specify AutoPauseDelay. + */ + interface WithAutoPauseDelay { + /** + * Specifies autoPauseDelay. + * @param autoPauseDelay Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled + * @return the next update stage + */ + Update withAutoPauseDelay(Integer autoPauseDelay); + } + /** * The stage of the database update allowing to specify CatalogCollation. */ @@ -540,7 +620,7 @@ interface WithElasticPoolId { interface WithLicenseType { /** * Specifies licenseType. - * @param licenseType The license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice' + * @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice' * @return the next update stage */ Update withLicenseType(DatabaseLicenseType licenseType); @@ -570,13 +650,37 @@ interface WithMaxSizeBytes { Update withMaxSizeBytes(Long maxSizeBytes); } + /** + * The stage of the database update allowing to specify MinCapacity. + */ + interface WithMinCapacity { + /** + * Specifies minCapacity. + * @param minCapacity Minimal capacity that database will always have allocated, if not paused + * @return the next update stage + */ + Update withMinCapacity(Double minCapacity); + } + + /** + * The stage of the database update allowing to specify ReadReplicaCount. + */ + interface WithReadReplicaCount { + /** + * Specifies readReplicaCount. + * @param readReplicaCount The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases + * @return the next update stage + */ + Update withReadReplicaCount(Integer readReplicaCount); + } + /** * The stage of the database update allowing to specify ReadScale. */ interface WithReadScale { /** * Specifies readScale. - * @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled' + * @param readScale If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled' * @return the next update stage */ Update withReadScale(DatabaseReadScale readScale); diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseStatus.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseStatus.java index 9f978f320c7d2..2ff77e5d7f2cd 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseStatus.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseStatus.java @@ -70,6 +70,15 @@ public final class DatabaseStatus extends ExpandableStringEnum { /** Static value Scaling for DatabaseStatus. */ public static final DatabaseStatus SCALING = fromString("Scaling"); + /** Static value OfflineChangingDwPerformanceTiers for DatabaseStatus. */ + public static final DatabaseStatus OFFLINE_CHANGING_DW_PERFORMANCE_TIERS = fromString("OfflineChangingDwPerformanceTiers"); + + /** Static value OnlineChangingDwPerformanceTiers for DatabaseStatus. */ + public static final DatabaseStatus ONLINE_CHANGING_DW_PERFORMANCE_TIERS = fromString("OnlineChangingDwPerformanceTiers"); + + /** Static value Disabled for DatabaseStatus. */ + public static final DatabaseStatus DISABLED = fromString("Disabled"); + /** * Creates or finds a DatabaseStatus from its string representation. * @param name a name to look for diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseUpdate.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseUpdate.java index eafe8ef45060a..5bb8734ee5a78 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseUpdate.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseUpdate.java @@ -106,7 +106,8 @@ public class DatabaseUpdate { * 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', * 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', * 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', - * 'Resuming', 'Scaling'. + * 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + * 'OnlineChangingDwPerformanceTiers', 'Disabled'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) private DatabaseStatus status; @@ -203,7 +204,9 @@ public class DatabaseUpdate { private Boolean zoneRedundant; /** - * The license type to apply for this database. Possible values include: + * The license type to apply for this database. `LicenseIncluded` if you + * need a license, or `BasePrice` if you have a license and are eligible + * for the Azure Hybrid Benefit. Possible values include: * 'LicenseIncluded', 'BasePrice'. */ @JsonProperty(value = "properties.licenseType") @@ -223,20 +226,56 @@ public class DatabaseUpdate { private DateTime earliestRestoreDate; /** - * The state of read-only routing. If enabled, connections that have - * application intent set to readonly in their connection string may be - * routed to a readonly secondary replica in the same region. Possible - * values include: 'Enabled', 'Disabled'. + * If enabled, connections that have application intent set to readonly in + * their connection string may be routed to a readonly secondary replica. + * This property is only settable for Premium and Business Critical + * databases. Possible values include: 'Enabled', 'Disabled'. */ @JsonProperty(value = "properties.readScale") private DatabaseReadScale readScale; + /** + * The number of readonly secondary replicas associated with the database + * to which readonly application intent connections may be routed. This + * property is only settable for Hyperscale edition databases. + */ + @JsonProperty(value = "properties.readReplicaCount") + private Integer readReplicaCount; + /** * The name and tier of the SKU. */ @JsonProperty(value = "properties.currentSku", access = JsonProperty.Access.WRITE_ONLY) private Sku currentSku; + /** + * Time in minutes after which database is automatically paused. A value of + * -1 means that automatic pause is disabled. + */ + @JsonProperty(value = "properties.autoPauseDelay") + private Integer autoPauseDelay; + + /** + * Minimal capacity that database will always have allocated, if not + * paused. + */ + @JsonProperty(value = "properties.minCapacity") + private Double minCapacity; + + /** + * The date when database was paused by user configuration or action + * (ISO8601 format). Null if the database is ready. + */ + @JsonProperty(value = "properties.pausedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime pausedDate; + + /** + * The date when database was resumed by user action or database login + * (ISO8601 format). Null if the database is paused. + */ + @JsonProperty(value = "properties.resumedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime resumedDate; + /** * Resource tags. */ @@ -400,7 +439,7 @@ public DatabaseUpdate withSourceDatabaseId(String sourceDatabaseId) { } /** - * Get the status of the database. Possible values include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling'. + * Get the status of the database. Possible values include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', 'OnlineChangingDwPerformanceTiers', 'Disabled'. * * @return the status value */ @@ -623,7 +662,7 @@ public DatabaseUpdate withZoneRedundant(Boolean zoneRedundant) { } /** - * Get the license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice'. + * Get the license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice'. * * @return the licenseType value */ @@ -632,7 +671,7 @@ public DatabaseLicenseType licenseType() { } /** - * Set the license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice'. + * Set the license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice'. * * @param licenseType the licenseType value to set * @return the DatabaseUpdate object itself. @@ -661,7 +700,7 @@ public DateTime earliestRestoreDate() { } /** - * Get the state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled'. + * Get if enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled'. * * @return the readScale value */ @@ -670,7 +709,7 @@ public DatabaseReadScale readScale() { } /** - * Set the state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled'. + * Set if enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled'. * * @param readScale the readScale value to set * @return the DatabaseUpdate object itself. @@ -680,6 +719,26 @@ public DatabaseUpdate withReadScale(DatabaseReadScale readScale) { return this; } + /** + * Get the number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases. + * + * @return the readReplicaCount value + */ + public Integer readReplicaCount() { + return this.readReplicaCount; + } + + /** + * Set the number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases. + * + * @param readReplicaCount the readReplicaCount value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withReadReplicaCount(Integer readReplicaCount) { + this.readReplicaCount = readReplicaCount; + return this; + } + /** * Get the name and tier of the SKU. * @@ -689,6 +748,64 @@ public Sku currentSku() { return this.currentSku; } + /** + * Get time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. + * + * @return the autoPauseDelay value + */ + public Integer autoPauseDelay() { + return this.autoPauseDelay; + } + + /** + * Set time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. + * + * @param autoPauseDelay the autoPauseDelay value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withAutoPauseDelay(Integer autoPauseDelay) { + this.autoPauseDelay = autoPauseDelay; + return this; + } + + /** + * Get minimal capacity that database will always have allocated, if not paused. + * + * @return the minCapacity value + */ + public Double minCapacity() { + return this.minCapacity; + } + + /** + * Set minimal capacity that database will always have allocated, if not paused. + * + * @param minCapacity the minCapacity value to set + * @return the DatabaseUpdate object itself. + */ + public DatabaseUpdate withMinCapacity(Double minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the date when database was paused by user configuration or action (ISO8601 format). Null if the database is ready. + * + * @return the pausedDate value + */ + public DateTime pausedDate() { + return this.pausedDate; + } + + /** + * Get the date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. + * + * @return the resumedDate value + */ + public DateTime resumedDate() { + return this.resumedDate; + } + /** * Get resource tags. * diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java index ca7e01e28e6b3..c01762ebec27d 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/DatabaseVulnerabilityAssessment.java @@ -129,7 +129,7 @@ interface WithStorageContainerPath { interface WithStorageContainerSasKey { /** * Specifies storageContainerSasKey. - * @param storageContainerSasKey A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required + * @param storageContainerSasKey A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required * @return the next definition stage */ WithCreate withStorageContainerSasKey(String storageContainerSasKey); @@ -195,7 +195,7 @@ interface WithStorageContainerPath { interface WithStorageContainerSasKey { /** * Specifies storageContainerSasKey. - * @param storageContainerSasKey A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required + * @param storageContainerSasKey A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required * @return the next update stage */ Update withStorageContainerSasKey(String storageContainerSasKey); diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Databases.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Databases.java index a0ce679208269..a562a69c72f57 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Databases.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Databases.java @@ -18,17 +18,6 @@ * Type representing Databases. */ public interface Databases extends SupportsCreating, HasInner { - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Completable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName); - /** * Gets a list of databases in an elastic pool. * @@ -62,6 +51,17 @@ public interface Databases extends SupportsCreating resumeAsync(String resourceGroupName, String serverName, String databaseName); + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName); + /** * Renames a database. * diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ElasticPool.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ElasticPool.java index c7b12d377c527..fa4d492b98f7a 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ElasticPool.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ElasticPool.java @@ -172,7 +172,11 @@ interface WithPerDatabaseSettings { interface WithSku { /** * Specifies sku. - * @param sku the sku parameter value + * @param sku The elastic pool SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: + ```azurecli + az sql elastic-pool list-editions -l <location> -o table + ```` * @return the next definition stage */ WithCreate withSku(Sku sku); diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedInstanceEncryptionProtectors.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedInstanceEncryptionProtectors.java index 228e27215ed8e..b40ae963ac4cb 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedInstanceEncryptionProtectors.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/ManagedInstanceEncryptionProtectors.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.sql.v2017_10_01_preview; +import rx.Completable; import rx.Observable; import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.ManagedInstanceEncryptionProtectorInner; import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.ManagedInstanceEncryptionProtectorsInner; @@ -17,6 +18,16 @@ * Type representing ManagedInstanceEncryptionProtectors. */ public interface ManagedInstanceEncryptionProtectors extends HasInner { + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revalidateAsync(String resourceGroupName, String managedInstanceName); + /** * Gets a list of managed instance encryption protectors. * diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabase.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabase.java new file mode 100644 index 0000000000000..eca31ea913046 --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabase.java @@ -0,0 +1,42 @@ +/** + * 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.v2017_10_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.RecoverableManagedDatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.SqlManager; + +/** + * Type representing RecoverableManagedDatabase. + */ +public interface RecoverableManagedDatabase extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastAvailableBackupDate value. + */ + String lastAvailableBackupDate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabases.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabases.java new file mode 100644 index 0000000000000..c73338b1d549a --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/RecoverableManagedDatabases.java @@ -0,0 +1,40 @@ +/** + * 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.v2017_10_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.sql.v2017_10_01_preview.implementation.RecoverableManagedDatabasesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RecoverableManagedDatabases. + */ +public interface RecoverableManagedDatabases extends HasInner { + /** + * Gets a recoverable managed database. + * + * @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 managedInstanceName The name of the managed instance. + * @param recoverableDatabaseName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName); + + /** + * Gets a list of recoverable managed databases. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInstanceAsync(final String resourceGroupName, final String managedInstanceName); + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Sku.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Sku.java index 1e666f1e4dafc..dbd4e0f4bdf98 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Sku.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/Sku.java @@ -11,25 +11,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The resource model definition representing SKU. + * An ARM Resource SKU. */ public class Sku { /** - * The name of the SKU. Ex - P3. It is typically a letter+number code. + * The name of the SKU, typically, a letter + Number code, e.g. P3. */ @JsonProperty(value = "name", required = true) private String name; /** - * This field is required to be implemented by the Resource Provider if the - * service has more than one tier, but is not required on a PUT. + * The tier or edition of the particular SKU, e.g. Basic, Premium. */ @JsonProperty(value = "tier") private String tier; /** - * The SKU size. When the name field is the combination of tier and some - * other value, this would be the standalone code. + * Size of the particular SKU. */ @JsonProperty(value = "size") private String size; @@ -42,15 +40,13 @@ public class Sku { private String family; /** - * If the SKU supports scale out/in then the capacity integer should be - * included. If scale out/in is not possible for the resource this may be - * omitted. + * Capacity of the particular SKU. */ @JsonProperty(value = "capacity") private Integer capacity; /** - * Get the name of the SKU. Ex - P3. It is typically a letter+number code. + * Get the name of the SKU, typically, a letter + Number code, e.g. P3. * * @return the name value */ @@ -59,7 +55,7 @@ public String name() { } /** - * Set the name of the SKU. Ex - P3. It is typically a letter+number code. + * Set the name of the SKU, typically, a letter + Number code, e.g. P3. * * @param name the name value to set * @return the Sku object itself. @@ -70,7 +66,7 @@ public Sku withName(String name) { } /** - * Get this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + * Get the tier or edition of the particular SKU, e.g. Basic, Premium. * * @return the tier value */ @@ -79,7 +75,7 @@ public String tier() { } /** - * Set this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + * Set the tier or edition of the particular SKU, e.g. Basic, Premium. * * @param tier the tier value to set * @return the Sku object itself. @@ -90,7 +86,7 @@ public Sku withTier(String tier) { } /** - * Get the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * Get size of the particular SKU. * * @return the size value */ @@ -99,7 +95,7 @@ public String size() { } /** - * Set the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * Set size of the particular SKU. * * @param size the size value to set * @return the Sku object itself. @@ -130,7 +126,7 @@ public Sku withFamily(String family) { } /** - * Get if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * Get capacity of the particular SKU. * * @return the capacity value */ @@ -139,7 +135,7 @@ public Integer capacity() { } /** - * Set if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * Set capacity of the particular SKU. * * @param capacity the capacity value to set * @return the Sku object itself. diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesImpl.java index 8fde97f0db81a..a7cf7aedbc20a 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesImpl.java @@ -63,10 +63,14 @@ public BackupShortTermRetentionPolicy call(BackupShortTermRetentionPolicyInner i public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { BackupShortTermRetentionPoliciesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, databaseName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public BackupShortTermRetentionPolicy call(BackupShortTermRetentionPolicyInner inner) { - return wrapModel(inner); + public Observable call(BackupShortTermRetentionPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupShortTermRetentionPolicy)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseImpl.java index 57538e6de24cf..1660bec1e3157 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseImpl.java @@ -101,6 +101,11 @@ private void resetCreateUpdateParameters() { this.updateParameter = new DatabaseUpdate(); } + @Override + public Integer autoPauseDelay() { + return this.inner().autoPauseDelay(); + } + @Override public CatalogCollationType catalogCollation() { return this.inner().catalogCollation(); @@ -196,11 +201,26 @@ public Long maxSizeBytes() { return this.inner().maxSizeBytes(); } + @Override + public Double minCapacity() { + return this.inner().minCapacity(); + } + @Override public String name() { return this.inner().name(); } + @Override + public DateTime pausedDate() { + return this.inner().pausedDate(); + } + + @Override + public Integer readReplicaCount() { + return this.inner().readReplicaCount(); + } + @Override public DatabaseReadScale readScale() { return this.inner().readScale(); @@ -231,6 +251,11 @@ public DateTime restorePointInTime() { return this.inner().restorePointInTime(); } + @Override + public DateTime resumedDate() { + return this.inner().resumedDate(); + } + @Override public SampleName sampleName() { return this.inner().sampleName(); @@ -284,6 +309,16 @@ public DatabaseImpl withLocation(String location) { return this; } + @Override + public DatabaseImpl withAutoPauseDelay(Integer autoPauseDelay) { + if (isInCreateMode()) { + this.inner().withAutoPauseDelay(autoPauseDelay); + } else { + this.updateParameter.withAutoPauseDelay(autoPauseDelay); + } + return this; + } + @Override public DatabaseImpl withCatalogCollation(CatalogCollationType catalogCollation) { if (isInCreateMode()) { @@ -354,6 +389,26 @@ public DatabaseImpl withMaxSizeBytes(Long maxSizeBytes) { return this; } + @Override + public DatabaseImpl withMinCapacity(Double minCapacity) { + if (isInCreateMode()) { + this.inner().withMinCapacity(minCapacity); + } else { + this.updateParameter.withMinCapacity(minCapacity); + } + return this; + } + + @Override + public DatabaseImpl withReadReplicaCount(Integer readReplicaCount) { + if (isInCreateMode()) { + this.inner().withReadReplicaCount(readReplicaCount); + } else { + this.updateParameter.withReadReplicaCount(readReplicaCount); + } + return this; + } + @Override public DatabaseImpl withReadScale(DatabaseReadScale readScale) { if (isInCreateMode()) { diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseInner.java index 9c0e11f49b7f6..98ae8ff29921b 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseInner.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseInner.java @@ -27,7 +27,20 @@ @JsonFlatten public class DatabaseInner extends Resource { /** - * The name and tier of the SKU. + * The database SKU. + * + * The list of SKUs may vary by region and support offer. To determine the + * SKUs (including the SKU name, tier/edition, family, and capacity) that + * are available to your subscription in an Azure region, use the + * `Capabilities_ListByLocation` REST API or one of the following commands: + * + * ```azurecli + * az sql db list-editions -l <location> -o table + * ```` + * + * ```powershell + * Get-AzSqlServerServiceObjective -Location <location> + * ````. */ @JsonProperty(value = "sku") private Sku sku; @@ -125,7 +138,8 @@ public class DatabaseInner extends Resource { * 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', * 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', * 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', - * 'Resuming', 'Scaling'. + * 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + * 'OnlineChangingDwPerformanceTiers', 'Disabled'. */ @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) private DatabaseStatus status; @@ -222,7 +236,9 @@ public class DatabaseInner extends Resource { private Boolean zoneRedundant; /** - * The license type to apply for this database. Possible values include: + * The license type to apply for this database. `LicenseIncluded` if you + * need a license, or `BasePrice` if you have a license and are eligible + * for the Azure Hybrid Benefit. Possible values include: * 'LicenseIncluded', 'BasePrice'. */ @JsonProperty(value = "properties.licenseType") @@ -242,14 +258,22 @@ public class DatabaseInner extends Resource { private DateTime earliestRestoreDate; /** - * The state of read-only routing. If enabled, connections that have - * application intent set to readonly in their connection string may be - * routed to a readonly secondary replica in the same region. Possible - * values include: 'Enabled', 'Disabled'. + * If enabled, connections that have application intent set to readonly in + * their connection string may be routed to a readonly secondary replica. + * This property is only settable for Premium and Business Critical + * databases. Possible values include: 'Enabled', 'Disabled'. */ @JsonProperty(value = "properties.readScale") private DatabaseReadScale readScale; + /** + * The number of readonly secondary replicas associated with the database + * to which readonly application intent connections may be routed. This + * property is only settable for Hyperscale edition databases. + */ + @JsonProperty(value = "properties.readReplicaCount") + private Integer readReplicaCount; + /** * The name and tier of the SKU. */ @@ -257,7 +281,42 @@ public class DatabaseInner extends Resource { private Sku currentSku; /** - * Get the name and tier of the SKU. + * Time in minutes after which database is automatically paused. A value of + * -1 means that automatic pause is disabled. + */ + @JsonProperty(value = "properties.autoPauseDelay") + private Integer autoPauseDelay; + + /** + * Minimal capacity that database will always have allocated, if not + * paused. + */ + @JsonProperty(value = "properties.minCapacity") + private Double minCapacity; + + /** + * The date when database was paused by user configuration or action + * (ISO8601 format). Null if the database is ready. + */ + @JsonProperty(value = "properties.pausedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime pausedDate; + + /** + * The date when database was resumed by user action or database login + * (ISO8601 format). Null if the database is paused. + */ + @JsonProperty(value = "properties.resumedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime resumedDate; + + /** + * Get the database SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l <location> -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location <location> + ````. * * @return the sku value */ @@ -266,7 +325,14 @@ public Sku sku() { } /** - * Set the name and tier of the SKU. + * Set the database SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l <location> -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location <location> + ````. * * @param sku the sku value to set * @return the DatabaseInner object itself. @@ -431,7 +497,7 @@ public DatabaseInner withSourceDatabaseId(String sourceDatabaseId) { } /** - * Get the status of the database. Possible values include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling'. + * Get the status of the database. Possible values include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', 'OnlineChangingDwPerformanceTiers', 'Disabled'. * * @return the status value */ @@ -654,7 +720,7 @@ public DatabaseInner withZoneRedundant(Boolean zoneRedundant) { } /** - * Get the license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice'. + * Get the license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice'. * * @return the licenseType value */ @@ -663,7 +729,7 @@ public DatabaseLicenseType licenseType() { } /** - * Set the license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice'. + * Set the license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice'. * * @param licenseType the licenseType value to set * @return the DatabaseInner object itself. @@ -692,7 +758,7 @@ public DateTime earliestRestoreDate() { } /** - * Get the state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled'. + * Get if enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled'. * * @return the readScale value */ @@ -701,7 +767,7 @@ public DatabaseReadScale readScale() { } /** - * Set the state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'Enabled', 'Disabled'. + * Set if enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases. Possible values include: 'Enabled', 'Disabled'. * * @param readScale the readScale value to set * @return the DatabaseInner object itself. @@ -711,6 +777,26 @@ public DatabaseInner withReadScale(DatabaseReadScale readScale) { return this; } + /** + * Get the number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases. + * + * @return the readReplicaCount value + */ + public Integer readReplicaCount() { + return this.readReplicaCount; + } + + /** + * Set the number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases. + * + * @param readReplicaCount the readReplicaCount value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withReadReplicaCount(Integer readReplicaCount) { + this.readReplicaCount = readReplicaCount; + return this; + } + /** * Get the name and tier of the SKU. * @@ -720,4 +806,62 @@ public Sku currentSku() { return this.currentSku; } + /** + * Get time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. + * + * @return the autoPauseDelay value + */ + public Integer autoPauseDelay() { + return this.autoPauseDelay; + } + + /** + * Set time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. + * + * @param autoPauseDelay the autoPauseDelay value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withAutoPauseDelay(Integer autoPauseDelay) { + this.autoPauseDelay = autoPauseDelay; + return this; + } + + /** + * Get minimal capacity that database will always have allocated, if not paused. + * + * @return the minCapacity value + */ + public Double minCapacity() { + return this.minCapacity; + } + + /** + * Set minimal capacity that database will always have allocated, if not paused. + * + * @param minCapacity the minCapacity value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withMinCapacity(Double minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the date when database was paused by user configuration or action (ISO8601 format). Null if the database is ready. + * + * @return the pausedDate value + */ + public DateTime pausedDate() { + return this.pausedDate; + } + + /** + * Get the date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. + * + * @return the resumedDate value + */ + public DateTime resumedDate() { + return this.resumedDate; + } + } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java index fecaa4caac857..cfefe0dad92f8 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentInner.java @@ -27,8 +27,8 @@ public class DatabaseVulnerabilityAssessmentInner extends ProxyResource { private String storageContainerPath; /** - * A shared access signature (SAS Key) that has write access to the blob - * container specified in 'storageContainerPath' parameter. If + * A shared access signature (SAS Key) that has read and write access to + * the blob container specified in 'storageContainerPath' parameter. If * 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is * required. */ @@ -70,7 +70,7 @@ public DatabaseVulnerabilityAssessmentInner withStorageContainerPath(String stor } /** - * Get a shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. + * Get a shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. * * @return the storageContainerSasKey value */ @@ -79,7 +79,7 @@ public String storageContainerSasKey() { } /** - * Set a shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. + * Set a shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. * * @param storageContainerSasKey the storageContainerSasKey value to set * @return the DatabaseVulnerabilityAssessmentInner object itself. diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselineImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselineImpl.java index cdae43ef347f3..7c4b03e3bda78 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselineImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselineImpl.java @@ -29,7 +29,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselineImpl extends CreatableUpdatable super(name, new DatabaseVulnerabilityAssessmentRuleBaselineInner()); this.manager = manager; // Set resource name - this.baselineName = VulnerabilityAssessmentPolicyBaselineName.fromString(name); + this.baselineName = name; // } @@ -37,7 +37,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselineImpl extends CreatableUpdatable super(inner.name(), inner); this.manager = manager; // Set resource name - this.baselineName = VulnerabilityAssessmentPolicyBaselineName.fromString(inner.name()); + this.baselineName = inner.name(); // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.managedInstanceName = IdParsingUtils.getValueFromIdByName(inner.id(), "managedInstances"); diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansImpl.java index 085c9d4b32120..cd0ca72ea286f 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansImpl.java @@ -47,10 +47,14 @@ private Observable getVulnerabilityAsses public Observable getAsync(String resourceGroupName, String serverName, String databaseName, String scanId) { DatabaseVulnerabilityAssessmentScansInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, databaseName, scanId) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ServerVulnerabilityAssessmentScanRecord call(VulnerabilityAssessmentScanRecordInner inner) { - return wrapServerVulnerabilityAssessmentScanRecordModel(inner); + public Observable call(VulnerabilityAssessmentScanRecordInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ServerVulnerabilityAssessmentScanRecord)wrapServerVulnerabilityAssessmentScanRecordModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesImpl.java index 03664427619c3..229e59408a4a5 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesImpl.java @@ -42,12 +42,6 @@ private DatabaseImpl wrapModel(String name) { return new DatabaseImpl(name, this.manager()); } - @Override - public Completable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { - DatabasesInner client = this.inner(); - return client.upgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).toCompletable(); - } - @Override public Observable listByElasticPoolAsync(final String resourceGroupName, final String serverName, final String elasticPoolName) { DatabasesInner client = this.inner(); @@ -90,6 +84,12 @@ public Database call(DatabaseInner inner) { }); } + @Override + public Completable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { + DatabasesInner client = this.inner(); + return client.upgradeDataWarehouseAsync(resourceGroupName, serverName, databaseName).toCompletable(); + } + @Override public Completable renameAsync(String resourceGroupName, String serverName, String databaseName, String id) { DatabasesInner client = this.inner(); @@ -118,10 +118,14 @@ public Database call(DatabaseInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { DatabasesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, databaseName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Database call(DatabaseInner inner) { - return wrapModel(inner); + public Observable call(DatabaseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Database)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java index ae43311abb3de..ad3c5a99b013a 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java @@ -65,14 +65,6 @@ public DatabasesInner(Retrofit retrofit, SqlManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface DatabasesService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.Databases upgradeDataWarehouse" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") - Observable> upgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2017_10_01_preview.Databases beginUpgradeDataWarehouse" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") - Observable> beginUpgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2017_10_01_preview.Databases listByServer" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases") Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -125,6 +117,14 @@ interface DatabasesService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume") Observable> beginResume(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2017_10_01_preview.Databases upgradeDataWarehouse" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") + Observable> upgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2017_10_01_preview.Databases beginUpgradeDataWarehouse" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse") + Observable> beginUpgradeDataWarehouse(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2017_10_01_preview.Databases rename" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move") Observable> rename(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceMoveDefinition parameters, @Header("User-Agent") String userAgent); @@ -139,174 +139,6 @@ interface DatabasesService { } - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @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 upgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) { - upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @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 upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { - return upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> upgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serverName == null) { - throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); - } - if (databaseName == null) { - throw new IllegalArgumentException("Parameter databaseName 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.upgradeDataWarehouse(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @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 beginUpgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) { - beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @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 beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { - return beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Upgrades a data warehouse. - * - * @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 serverName The name of the server. - * @param databaseName The name of the database to be upgraded. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> beginUpgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serverName == null) { - throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); - } - if (databaseName == null) { - throw new IllegalArgumentException("Parameter databaseName 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.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, 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 = beginUpgradeDataWarehouseDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginUpgradeDataWarehouseDelegate(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 databases. * @@ -1536,6 +1368,174 @@ private ServiceResponse beginResumeDelegate(Response upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { + return upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> upgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.upgradeDataWarehouse(resourceGroupName, serverName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @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 beginUpgradeDataWarehouse(String resourceGroupName, String serverName, String databaseName) { + beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @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 beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) { + return beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrades a data warehouse. + * + * @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 serverName The name of the server. + * @param databaseName The name of the database to be upgraded. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpgradeDataWarehouseWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, 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 = beginUpgradeDataWarehouseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpgradeDataWarehouseDelegate(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); + } + /** * Renames a database. * diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolInner.java index e7e1135945e93..d5a449ff60bd5 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolInner.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolInner.java @@ -23,7 +23,16 @@ @JsonFlatten public class ElasticPoolInner extends Resource { /** - * The sku property. + * The elastic pool SKU. + * + * The list of SKUs may vary by region and support offer. To determine the + * SKUs (including the SKU name, tier/edition, family, and capacity) that + * are available to your subscription in an Azure region, use the + * `Capabilities_ListByLocation` REST API or the following command: + * + * ```azurecli + * az sql elastic-pool list-editions -l <location> -o table + * ````. */ @JsonProperty(value = "sku") private Sku sku; @@ -76,7 +85,11 @@ public class ElasticPoolInner extends Resource { private ElasticPoolLicenseType licenseType; /** - * Get the sku value. + * Get the elastic pool SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: + ```azurecli + az sql elastic-pool list-editions -l <location> -o table + ````. * * @return the sku value */ @@ -85,7 +98,11 @@ public Sku sku() { } /** - * Set the sku value. + * Set the elastic pool SKU. + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command: + ```azurecli + az sql elastic-pool list-editions -l <location> -o table + ````. * * @param sku the sku value to set * @return the ElasticPoolInner object itself. diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolsImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolsImpl.java index 98ef70fe4456e..ac8bfae7a1d69 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolsImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ElasticPoolsImpl.java @@ -64,10 +64,14 @@ public ElasticPool call(ElasticPoolInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String elasticPoolName) { ElasticPoolsInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, elasticPoolName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ElasticPool call(ElasticPoolInner inner) { - return wrapModel(inner); + public Observable call(ElasticPoolInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ElasticPool)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsImpl.java index 1cb58ee5e90f3..8274729e047c3 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsImpl.java @@ -88,10 +88,14 @@ public InstanceFailoverGroup call(InstanceFailoverGroupInner inner) { public Observable getAsync(String resourceGroupName, String locationName, String failoverGroupName) { InstanceFailoverGroupsInner client = this.inner(); return client.getAsync(resourceGroupName, locationName, failoverGroupName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public InstanceFailoverGroup call(InstanceFailoverGroupInner inner) { - return wrapModel(inner); + public Observable call(InstanceFailoverGroupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((InstanceFailoverGroup)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesImpl.java index 7b7f4ee695439..dd7fb20e40b4e 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentRuleBaselinesImpl.java @@ -11,7 +11,6 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedDatabaseVulnerabilityAssessmentRuleBaselines; -import com.microsoft.azure.management.sql.v2017_10_01_preview.VulnerabilityAssessmentPolicyBaselineName; import rx.Observable; import rx.functions.Func1; import com.microsoft.azure.management.sql.v2017_10_01_preview.DatabaseVulnerabilityAssessmentRuleBaseline; @@ -47,7 +46,7 @@ private Observable getDatabase String managedInstanceName = IdParsingUtils.getValueFromIdByName(id, "managedInstances"); String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); String ruleId = IdParsingUtils.getValueFromIdByName(id, "rules"); - VulnerabilityAssessmentPolicyBaselineName baselineName = VulnerabilityAssessmentPolicyBaselineName.valueOf(IdParsingUtils.getValueFromIdByName(id, "baselines")); + String baselineName = VulnerabilityAssessmentPolicyBaselineName.valueOf(IdParsingUtils.getValueFromIdByName(id, "baselines")); ManagedDatabaseVulnerabilityAssessmentRuleBaselinesInner client = this.inner(); return client.getAsync(resourceGroupName, managedInstanceName, databaseName, ruleId, baselineName); } @@ -56,10 +55,14 @@ private Observable getDatabase public Observable getAsync(String resourceGroupName, String managedInstanceName, String databaseName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { ManagedDatabaseVulnerabilityAssessmentRuleBaselinesInner client = this.inner(); return client.getAsync(resourceGroupName, managedInstanceName, databaseName, ruleId, baselineName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public DatabaseVulnerabilityAssessmentRuleBaseline call(DatabaseVulnerabilityAssessmentRuleBaselineInner inner) { - return wrapDatabaseVulnerabilityAssessmentRuleBaselineModel(inner); + public Observable call(DatabaseVulnerabilityAssessmentRuleBaselineInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DatabaseVulnerabilityAssessmentRuleBaseline)wrapDatabaseVulnerabilityAssessmentRuleBaselineModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansImpl.java index 161455d1fb421..cea4b0b981329 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansImpl.java @@ -74,10 +74,14 @@ public ManagedInstanceVulnerabilityAssessmentScanRecord call(VulnerabilityAssess public Observable getAsync(String resourceGroupName, String managedInstanceName, String databaseName, String scanId) { ManagedDatabaseVulnerabilityAssessmentScansInner client = this.inner(); return client.getAsync(resourceGroupName, managedInstanceName, databaseName, scanId) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ManagedInstanceVulnerabilityAssessmentScanRecord call(VulnerabilityAssessmentScanRecordInner inner) { - return wrapModel(inner); + public Observable call(VulnerabilityAssessmentScanRecordInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ManagedInstanceVulnerabilityAssessmentScanRecord)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java index 601d891194640..879b6c487c3a1 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentsImpl.java @@ -54,10 +54,14 @@ private Observable getDatabaseVulnerabilit public Observable getAsync(String resourceGroupName, String managedInstanceName, String databaseName) { ManagedDatabaseVulnerabilityAssessmentsInner client = this.inner(); return client.getAsync(resourceGroupName, managedInstanceName, databaseName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public DatabaseVulnerabilityAssessment call(DatabaseVulnerabilityAssessmentInner inner) { - return wrapDatabaseVulnerabilityAssessmentModel(inner); + public Observable call(DatabaseVulnerabilityAssessmentInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DatabaseVulnerabilityAssessment)wrapDatabaseVulnerabilityAssessmentModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsImpl.java index f5e79e61090bf..68cdd241e22ec 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceEncryptionProtectors; +import rx.Completable; import rx.functions.Func1; import rx.Observable; import com.microsoft.azure.Page; @@ -28,6 +29,12 @@ public SqlManager manager() { return this.manager; } + @Override + public Completable revalidateAsync(String resourceGroupName, String managedInstanceName) { + ManagedInstanceEncryptionProtectorsInner client = this.inner(); + return client.revalidateAsync(resourceGroupName, managedInstanceName).toCompletable(); + } + @Override public Observable listByInstanceAsync(final String resourceGroupName, final String managedInstanceName) { ManagedInstanceEncryptionProtectorsInner client = this.inner(); diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java index 303c257a8ea71..6958f4560f420 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java @@ -27,6 +27,7 @@ import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; @@ -60,6 +61,14 @@ public ManagedInstanceEncryptionProtectorsInner(Retrofit retrofit, SqlManagement * used by Retrofit to perform actually REST calls. */ interface ManagedInstanceEncryptionProtectorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceEncryptionProtectors revalidate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate") + Observable> revalidate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("encryptionProtectorName") String encryptionProtectorName, @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.v2017_10_01_preview.ManagedInstanceEncryptionProtectors beginRevalidate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate") + Observable> beginRevalidate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("encryptionProtectorName") String encryptionProtectorName, @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.v2017_10_01_preview.ManagedInstanceEncryptionProtectors listByInstance" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector") Observable> listByInstance(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -82,6 +91,162 @@ interface ManagedInstanceEncryptionProtectorsService { } + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @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 revalidate(String resourceGroupName, String managedInstanceName) { + revalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName).toBlocking().last().body(); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @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 revalidateAsync(String resourceGroupName, String managedInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName), serviceCallback); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable revalidateAsync(String resourceGroupName, String managedInstanceName) { + return revalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> revalidateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName 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."); + } + final String encryptionProtectorName = "current"; + Observable> observable = service.revalidate(resourceGroupName, managedInstanceName, encryptionProtectorName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @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 beginRevalidate(String resourceGroupName, String managedInstanceName) { + beginRevalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName).toBlocking().single().body(); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @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 beginRevalidateAsync(String resourceGroupName, String managedInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRevalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName), serviceCallback); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRevalidateAsync(String resourceGroupName, String managedInstanceName) { + return beginRevalidateWithServiceResponseAsync(resourceGroupName, managedInstanceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revalidates an existing encryption protector. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRevalidateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName 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."); + } + final String encryptionProtectorName = "current"; + return service.beginRevalidate(resourceGroupName, managedInstanceName, encryptionProtectorName, 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 = beginRevalidateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRevalidateDelegate(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 managed instance encryption protectors. * diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceKeysImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceKeysImpl.java index 5ec3eb2e0a0a6..ca9070a699849 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceKeysImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceKeysImpl.java @@ -64,10 +64,14 @@ public ManagedInstanceKey call(ManagedInstanceKeyInner inner) { public Observable getAsync(String resourceGroupName, String managedInstanceName, String keyName) { ManagedInstanceKeysInner client = this.inner(); return client.getAsync(resourceGroupName, managedInstanceName, keyName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ManagedInstanceKey call(ManagedInstanceKeyInner inner) { - return wrapModel(inner); + public Observable call(ManagedInstanceKeyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ManagedInstanceKey)wrapModel(inner)); + } } }); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseImpl.java new file mode 100644 index 0000000000000..9dbd7757bdf52 --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2017_10_01_preview.implementation; + +import com.microsoft.azure.management.sql.v2017_10_01_preview.RecoverableManagedDatabase; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class RecoverableManagedDatabaseImpl extends IndexableRefreshableWrapperImpl implements RecoverableManagedDatabase { + private final SqlManager manager; + private String resourceGroupName; + private String managedInstanceName; + private String recoverableDatabaseName; + + RecoverableManagedDatabaseImpl(RecoverableManagedDatabaseInner inner, SqlManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.managedInstanceName = IdParsingUtils.getValueFromIdByName(inner.id(), "managedInstances"); + this.recoverableDatabaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "recoverableDatabases"); + } + + @Override + public SqlManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + RecoverableManagedDatabasesInner client = this.manager().inner().recoverableManagedDatabases(); + return client.getAsync(this.resourceGroupName, this.managedInstanceName, this.recoverableDatabaseName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastAvailableBackupDate() { + return this.inner().lastAvailableBackupDate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseInner.java new file mode 100644 index 0000000000000..08d0cf8784a10 --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabaseInner.java @@ -0,0 +1,35 @@ +/** + * 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.v2017_10_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A recoverable managed database resource. + */ +@JsonFlatten +public class RecoverableManagedDatabaseInner extends ProxyResource { + /** + * The last available backup date. + */ + @JsonProperty(value = "properties.lastAvailableBackupDate", access = JsonProperty.Access.WRITE_ONLY) + private String lastAvailableBackupDate; + + /** + * Get the last available backup date. + * + * @return the lastAvailableBackupDate value + */ + public String lastAvailableBackupDate() { + return this.lastAvailableBackupDate; + } + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesImpl.java new file mode 100644 index 0000000000000..bda7ae3d13538 --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.sql.v2017_10_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.sql.v2017_10_01_preview.RecoverableManagedDatabases; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.sql.v2017_10_01_preview.RecoverableManagedDatabase; + +class RecoverableManagedDatabasesImpl extends WrapperImpl implements RecoverableManagedDatabases { + private final SqlManager manager; + + RecoverableManagedDatabasesImpl(SqlManager manager) { + super(manager.inner().recoverableManagedDatabases()); + this.manager = manager; + } + + public SqlManager manager() { + return this.manager; + } + + private RecoverableManagedDatabaseImpl wrapModel(RecoverableManagedDatabaseInner inner) { + return new RecoverableManagedDatabaseImpl(inner, manager()); + } + + @Override + public Observable listByInstanceAsync(final String resourceGroupName, final String managedInstanceName) { + RecoverableManagedDatabasesInner client = this.inner(); + return client.listByInstanceAsync(resourceGroupName, managedInstanceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecoverableManagedDatabase call(RecoverableManagedDatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName) { + RecoverableManagedDatabasesInner client = this.inner(); + return client.getAsync(resourceGroupName, managedInstanceName, recoverableDatabaseName) + .flatMap(new Func1>() { + @Override + public Observable call(RecoverableManagedDatabaseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((RecoverableManagedDatabase)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesInner.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesInner.java new file mode 100644 index 0000000000000..741eb5979e229 --- /dev/null +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/RecoverableManagedDatabasesInner.java @@ -0,0 +1,401 @@ +/** + * 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.v2017_10_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.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 RecoverableManagedDatabases. + */ +public class RecoverableManagedDatabasesInner { + /** The Retrofit service to perform REST calls. */ + private RecoverableManagedDatabasesService service; + /** The service client containing this operation class. */ + private SqlManagementClientImpl client; + + /** + * Initializes an instance of RecoverableManagedDatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RecoverableManagedDatabasesInner(Retrofit retrofit, SqlManagementClientImpl client) { + this.service = retrofit.create(RecoverableManagedDatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for RecoverableManagedDatabases to be + * used by Retrofit to perform actually REST calls. + */ + interface RecoverableManagedDatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2017_10_01_preview.RecoverableManagedDatabases listByInstance" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases") + Observable> listByInstance(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @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.v2017_10_01_preview.RecoverableManagedDatabases get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("recoverableDatabaseName") String recoverableDatabaseName, @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.v2017_10_01_preview.RecoverableManagedDatabases listByInstanceNext" }) + @GET + Observable> listByInstanceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of recoverable managed databases. + * + * @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 managedInstanceName The name of the managed instance. + * @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<RecoverableManagedDatabaseInner> object if successful. + */ + public PagedList listByInstance(final String resourceGroupName, final String managedInstanceName) { + ServiceResponse> response = listByInstanceSinglePageAsync(resourceGroupName, managedInstanceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByInstanceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of recoverable managed databases. + * + * @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 managedInstanceName The name of the managed instance. + * @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> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByInstanceSinglePageAsync(resourceGroupName, managedInstanceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByInstanceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of recoverable managed databases. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecoverableManagedDatabaseInner> object + */ + public Observable> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName) { + return listByInstanceWithServiceResponseAsync(resourceGroupName, managedInstanceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of recoverable managed databases. + * + * @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 managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecoverableManagedDatabaseInner> object + */ + public Observable>> listByInstanceWithServiceResponseAsync(final String resourceGroupName, final String managedInstanceName) { + return listByInstanceSinglePageAsync(resourceGroupName, managedInstanceName) + .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(listByInstanceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of recoverable managed databases. + * + 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. + ServiceResponse> * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecoverableManagedDatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByInstanceSinglePageAsync(final String resourceGroupName, final String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName 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.listByInstance(resourceGroupName, managedInstanceName, 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 = listByInstanceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByInstanceDelegate(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 recoverable managed database. + * + * @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 managedInstanceName The name of the managed instance. + * @param recoverableDatabaseName the String value + * @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 RecoverableManagedDatabaseInner object if successful. + */ + public RecoverableManagedDatabaseInner get(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName) { + return getWithServiceResponseAsync(resourceGroupName, managedInstanceName, recoverableDatabaseName).toBlocking().single().body(); + } + + /** + * Gets a recoverable managed database. + * + * @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 managedInstanceName The name of the managed instance. + * @param recoverableDatabaseName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, managedInstanceName, recoverableDatabaseName), serviceCallback); + } + + /** + * Gets a recoverable managed database. + * + * @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 managedInstanceName The name of the managed instance. + * @param recoverableDatabaseName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoverableManagedDatabaseInner object + */ + public Observable getAsync(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName) { + return getWithServiceResponseAsync(resourceGroupName, managedInstanceName, recoverableDatabaseName).map(new Func1, RecoverableManagedDatabaseInner>() { + @Override + public RecoverableManagedDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a recoverable managed database. + * + * @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 managedInstanceName The name of the managed instance. + * @param recoverableDatabaseName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoverableManagedDatabaseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, String recoverableDatabaseName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (recoverableDatabaseName == null) { + throw new IllegalArgumentException("Parameter recoverableDatabaseName 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.get(resourceGroupName, managedInstanceName, recoverableDatabaseName, 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 = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of recoverable managed databases. + * + * @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<RecoverableManagedDatabaseInner> object if successful. + */ + public PagedList listByInstanceNext(final String nextPageLink) { + ServiceResponse> response = listByInstanceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByInstanceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of recoverable managed databases. + * + * @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> listByInstanceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByInstanceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByInstanceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of recoverable managed databases. + * + * @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<RecoverableManagedDatabaseInner> object + */ + public Observable> listByInstanceNextAsync(final String nextPageLink) { + return listByInstanceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of recoverable managed databases. + * + * @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<RecoverableManagedDatabaseInner> object + */ + public Observable>> listByInstanceNextWithServiceResponseAsync(final String nextPageLink) { + return listByInstanceNextSinglePageAsync(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(listByInstanceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of recoverable managed databases. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecoverableManagedDatabaseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByInstanceNextSinglePageAsync(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.listByInstanceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByInstanceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByInstanceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java index d32e61c6610d1..ad2a3c376e69b 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManagementClientImpl.java @@ -327,6 +327,19 @@ public ManagedInstanceEncryptionProtectorsInner managedInstanceEncryptionProtect return this.managedInstanceEncryptionProtectors; } + /** + * The RecoverableManagedDatabasesInner object to access its operations. + */ + private RecoverableManagedDatabasesInner recoverableManagedDatabases; + + /** + * Gets the RecoverableManagedDatabasesInner object to access its operations. + * @return the RecoverableManagedDatabasesInner object. + */ + public RecoverableManagedDatabasesInner recoverableManagedDatabases() { + return this.recoverableManagedDatabases; + } + /** * Initializes an instance of SqlManagementClient client. * @@ -377,6 +390,7 @@ protected void initialize() { this.managedInstanceTdeCertificates = new ManagedInstanceTdeCertificatesInner(restClient().retrofit(), this); this.managedInstanceKeys = new ManagedInstanceKeysInner(restClient().retrofit(), this); this.managedInstanceEncryptionProtectors = new ManagedInstanceEncryptionProtectorsInner(restClient().retrofit(), this); + this.recoverableManagedDatabases = new RecoverableManagedDatabasesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java index f76a2962112b5..aeddeb2596b2a 100644 --- a/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java +++ b/sdk/sql/mgmt-v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/SqlManager.java @@ -31,6 +31,7 @@ import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceTdeCertificates; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceKeys; import com.microsoft.azure.management.sql.v2017_10_01_preview.ManagedInstanceEncryptionProtectors; +import com.microsoft.azure.management.sql.v2017_10_01_preview.RecoverableManagedDatabases; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -53,6 +54,7 @@ public final class SqlManager extends ManagerCore