From edec0a94f94cdb2940a790e8f28f3f9c5ec2e383 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 20 Mar 2018 12:18:41 -0700 Subject: [PATCH 1/2] Generated from d46bb586ff62b244d1a013497f9d4d9f500aa5ee (#2488) removing instanceFailoverGroup from readme --- .../lib/models/automaticTuningOptions.js | 88 + .../models/automaticTuningServerOptions.js | 87 + .../models/backupLongTermRetentionPolicy.js | 42 +- .../createDatabaseRestorePointDefinition.js | 53 + .../sqlManagement2/lib/models/database.js | 49 +- .../lib/models/databaseAutomaticTuning.js | 109 + .../lib/models/databaseOperation.js | 28 + .../lib/models/databaseUpdate.js | 49 +- .../lib/models/editionCapability.js | 10 + .../sqlManagement2/lib/models/elasticPool.js | 10 + .../models/elasticPoolEditionCapability.js | 10 + .../lib/models/elasticPoolOperation.js | 201 + .../models/elasticPoolOperationListResult.js | 69 + .../lib/models/elasticPoolUpdate.js | 10 + .../lib/models/importRequest.js | 15 +- .../sqlManagement2/lib/models/index.d.ts | 2632 +-- .../sqlManagement2/lib/models/index.js | 66 +- .../lib/models/longTermRetentionBackup.js | 129 + .../longTermRetentionBackupListResult.js | 69 + .../lib/models/resourceMoveDefinition.js | 52 + .../sqlManagement2/lib/models/restorePoint.js | 41 +- .../lib/models/restorePointListResult.js | 6 +- .../lib/models/serverAutomaticTuning.js | 109 + .../lib/models/serverDnsAlias.js | 81 + .../lib/models/serverDnsAliasAcquisition.js | 53 + .../lib/models/serverDnsAliasListResult.js | 69 + .../lib/models/sloUsageMetric.js | 12 +- .../lib/models/subscriptionUsage.js | 108 + .../lib/models/subscriptionUsageListResult.js | 69 + .../backupLongTermRetentionPolicies.js | 431 +- .../databaseAutomaticTuningOperations.js | 563 + .../lib/operations/databaseOperations.js | 4 +- .../lib/operations/databases.js | 6183 +++---- .../lib/operations/elasticPoolOperations.js | 728 + .../lib/operations/elasticPools.js | 1058 +- .../lib/operations/failoverGroups.js | 2 +- .../lib/operations/geoBackupPolicies.js | 6 +- .../sqlManagement2/lib/operations/index.d.ts | 13986 +++++++++------- .../sqlManagement2/lib/operations/index.js | 17 +- .../operations/longTermRetentionBackups.js | 2116 +++ .../lib/operations/replicationLinks.js | 4 +- .../lib/operations/restorePoints.js | 1195 +- .../serverAutomaticTuningOperations.js | 539 + .../operations/serverAzureADAdministrators.js | 8 +- .../lib/operations/serverDnsAliases.js | 2014 +++ .../lib/operations/serverKeys.js | 2 +- .../sqlManagement2/lib/operations/servers.js | 2 +- .../lib/operations/subscriptionUsages.js | 701 + .../lib/operations/syncAgents.js | 2 +- .../lib/operations/syncGroups.js | 2 +- .../lib/operations/syncMembers.js | 2 +- .../lib/operations/virtualNetworkRules.js | 2 +- .../lib/sqlManagementClient.d.ts | 22 +- .../sqlManagement2/lib/sqlManagementClient.js | 20 +- 54 files changed, 23316 insertions(+), 10619 deletions(-) create mode 100644 lib/services/sqlManagement2/lib/models/automaticTuningOptions.js create mode 100644 lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js create mode 100644 lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js create mode 100644 lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolOperation.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js create mode 100644 lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js create mode 100644 lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js create mode 100644 lib/services/sqlManagement2/lib/models/serverDnsAlias.js create mode 100644 lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js create mode 100644 lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/subscriptionUsage.js create mode 100644 lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js create mode 100644 lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js create mode 100644 lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js create mode 100644 lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js create mode 100644 lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js create mode 100644 lib/services/sqlManagement2/lib/operations/serverDnsAliases.js create mode 100644 lib/services/sqlManagement2/lib/operations/subscriptionUsages.js diff --git a/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js b/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js new file mode 100644 index 0000000000..cc8a4107e0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js @@ -0,0 +1,88 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Automatic tuning properties for individual advisors. + * + */ +class AutomaticTuningOptions { + /** + * Create a AutomaticTuningOptions. + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual + * state are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', + * 'QueryStoreReadOnly', 'NotSupported' + */ + constructor() { + } + + /** + * Defines the metadata of AutomaticTuningOptions + * + * @returns {object} metadata of AutomaticTuningOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'AutomaticTuningOptions', + type: { + name: 'Composite', + className: 'AutomaticTuningOptions', + modelProperties: { + desiredState: { + required: false, + serializedName: 'desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On', 'Default' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'actualState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On' ] + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'Number' + } + }, + reasonDesc: { + required: false, + readOnly: true, + serializedName: 'reasonDesc', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported' ] + } + } + } + } + }; + } +} + +module.exports = AutomaticTuningOptions; diff --git a/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js b/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js new file mode 100644 index 0000000000..139c420e84 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Automatic tuning properties for individual advisors. + * + */ +class AutomaticTuningServerOptions { + /** + * Create a AutomaticTuningServerOptions. + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual + * state are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured' + */ + constructor() { + } + + /** + * Defines the metadata of AutomaticTuningServerOptions + * + * @returns {object} metadata of AutomaticTuningServerOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'AutomaticTuningServerOptions', + type: { + name: 'Composite', + className: 'AutomaticTuningServerOptions', + modelProperties: { + desiredState: { + required: false, + serializedName: 'desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On', 'Default' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'actualState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On' ] + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'Number' + } + }, + reasonDesc: { + required: false, + readOnly: true, + serializedName: 'reasonDesc', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Disabled', 'AutoConfigured' ] + } + } + } + } + }; + } +} + +module.exports = AutomaticTuningServerOptions; diff --git a/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js b/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js index 380d2fc45e..59cab275c7 100644 --- a/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js +++ b/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js @@ -13,18 +13,21 @@ const models = require('./index'); /** - * A backup long term retention policy + * A long term retention policy. * * @extends models['ProxyResource'] */ class BackupLongTermRetentionPolicy extends models['ProxyResource'] { /** * Create a BackupLongTermRetentionPolicy. - * @member {string} [location] The geo-location where the resource lives - * @member {string} state The status of the backup long term retention - * policy. Possible values include: 'Disabled', 'Enabled' - * @member {string} recoveryServicesBackupPolicyResourceId The azure recovery - * services backup protection policy resource id + * @member {string} [weeklyRetention] The weekly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [monthlyRetention] The montly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [yearlyRetention] The yearly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {number} [weekOfYear] The week of year to take the yearly backup + * in an ISO 8601 format. */ constructor() { super(); @@ -68,28 +71,33 @@ class BackupLongTermRetentionPolicy extends models['ProxyResource'] { name: 'String' } }, - location: { + weeklyRetention: { required: false, - readOnly: true, - serializedName: 'location', + serializedName: 'properties.weeklyRetention', type: { name: 'String' } }, - state: { - required: true, - serializedName: 'properties.state', + monthlyRetention: { + required: false, + serializedName: 'properties.monthlyRetention', type: { - name: 'Enum', - allowedValues: [ 'Disabled', 'Enabled' ] + name: 'String' } }, - recoveryServicesBackupPolicyResourceId: { - required: true, - serializedName: 'properties.recoveryServicesBackupPolicyResourceId', + yearlyRetention: { + required: false, + serializedName: 'properties.yearlyRetention', type: { name: 'String' } + }, + weekOfYear: { + required: false, + serializedName: 'properties.weekOfYear', + type: { + name: 'Number' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js b/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js new file mode 100644 index 0000000000..da8769ff34 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js @@ -0,0 +1,53 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the information necessary to perform a create database restore + * point operation. + * + */ +class CreateDatabaseRestorePointDefinition { + /** + * Create a CreateDatabaseRestorePointDefinition. + * @member {string} restorePointLabel The restore point label to apply + */ + constructor() { + } + + /** + * Defines the metadata of CreateDatabaseRestorePointDefinition + * + * @returns {object} metadata of CreateDatabaseRestorePointDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateDatabaseRestorePointDefinition', + type: { + name: 'Composite', + className: 'CreateDatabaseRestorePointDefinition', + modelProperties: { + restorePointLabel: { + required: true, + serializedName: 'restorePointLabel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateDatabaseRestorePointDefinition; diff --git a/lib/services/sqlManagement2/lib/models/database.js b/lib/services/sqlManagement2/lib/models/database.js index f343877aa3..ea7b30a367 100644 --- a/lib/services/sqlManagement2/lib/models/database.js +++ b/lib/services/sqlManagement2/lib/models/database.js @@ -94,9 +94,11 @@ class Database extends models['TrackedResource'] { * createMode is NonReadableSecondary or OnlineSecondary, this value is * ignored. To see possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions -l westus --query [].name`. + * Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * @member {string} [maxSizeBytes] The max size of the database expressed in * bytes. If createMode is not Default, this value is ignored. To see * possible values, query the capabilities API @@ -111,7 +113,9 @@ class Database extends models['TrackedResource'] { * requestedServiceObjectiveName. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * @member {string} [requestedServiceObjectiveName] The name of the * configured service level objective of the database. This is the service * level objective that is in the process of being applied to the database. @@ -119,13 +123,28 @@ class Database extends models['TrackedResource'] { * serviceLevelObjective property. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', + * 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', + * 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', + * 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', + * 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', + * 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', + * 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', + * 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', + * 'DS2000', 'ElasticPool' * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * objective of the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', + * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', + * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', + * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', + * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {string} [status] The status of the database. * @member {string} [elasticPoolName] The name of the elastic pool the * database is in. If elasticPoolName and requestedServiceObjectiveName are @@ -149,6 +168,9 @@ class Database extends models['TrackedResource'] { * apply when creating this database. If createMode is not Default, this * value is ignored. Not supported for DataWarehouse edition. Possible values * include: 'AdventureWorksLT' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. */ constructor() { super(); @@ -432,6 +454,13 @@ class Database extends models['TrackedResource'] { type: { name: 'String' } + }, + zoneRedundant: { + required: false, + serializedName: 'properties.zoneRedundant', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js b/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js new file mode 100644 index 0000000000..c8e4237526 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Database-level Automatic Tuning. + * + * @extends models['ProxyResource'] + */ +class DatabaseAutomaticTuning extends models['ProxyResource'] { + /** + * Create a DatabaseAutomaticTuning. + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DatabaseAutomaticTuning + * + * @returns {object} metadata of DatabaseAutomaticTuning + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseAutomaticTuning', + type: { + name: 'Composite', + className: 'DatabaseAutomaticTuning', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + desiredState: { + required: false, + serializedName: 'properties.desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Inherit', 'Custom', 'Auto', 'Unspecified' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'properties.actualState', + type: { + name: 'Enum', + allowedValues: [ 'Inherit', 'Custom', 'Auto', 'Unspecified' ] + } + }, + options: { + required: false, + serializedName: 'properties.options', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AutomaticTuningOptionsElementType', + type: { + name: 'Composite', + className: 'AutomaticTuningOptions' + } + } + } + } + } + } + }; + } +} + +module.exports = DatabaseAutomaticTuning; diff --git a/lib/services/sqlManagement2/lib/models/databaseOperation.js b/lib/services/sqlManagement2/lib/models/databaseOperation.js index 5adb38425c..f38745c1c9 100644 --- a/lib/services/sqlManagement2/lib/models/databaseOperation.js +++ b/lib/services/sqlManagement2/lib/models/databaseOperation.js @@ -35,6 +35,10 @@ class DatabaseOperation extends models['ProxyResource'] { * @member {string} [errorDescription] The operation error description. * @member {number} [errorSeverity] The operation error severity. * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ constructor() { super(); @@ -165,6 +169,30 @@ class DatabaseOperation extends models['ProxyResource'] { type: { name: 'Boolean' } + }, + estimatedCompletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.estimatedCompletionTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + isCancellable: { + required: false, + readOnly: true, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseUpdate.js b/lib/services/sqlManagement2/lib/models/databaseUpdate.js index 6fbeb24f88..e0d2776b6b 100644 --- a/lib/services/sqlManagement2/lib/models/databaseUpdate.js +++ b/lib/services/sqlManagement2/lib/models/databaseUpdate.js @@ -93,9 +93,11 @@ class DatabaseUpdate extends models['Resource'] { * createMode is NonReadableSecondary or OnlineSecondary, this value is * ignored. To see possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions -l westus --query [].name`. + * Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * @member {string} [maxSizeBytes] The max size of the database expressed in * bytes. If createMode is not Default, this value is ignored. To see * possible values, query the capabilities API @@ -110,7 +112,9 @@ class DatabaseUpdate extends models['Resource'] { * requestedServiceObjectiveName. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * @member {string} [requestedServiceObjectiveName] The name of the * configured service level objective of the database. This is the service * level objective that is in the process of being applied to the database. @@ -118,13 +122,28 @@ class DatabaseUpdate extends models['Resource'] { * serviceLevelObjective property. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * referred to by operationId: "Capabilities_ListByLocation." or use the + * Azure CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', + * 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', + * 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', + * 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', + * 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', + * 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', + * 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', + * 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', + * 'DS2000', 'ElasticPool' * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * objective of the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', + * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', + * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', + * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', + * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {string} [status] The status of the database. * @member {string} [elasticPoolName] The name of the elastic pool the * database is in. If elasticPoolName and requestedServiceObjectiveName are @@ -148,6 +167,9 @@ class DatabaseUpdate extends models['Resource'] { * apply when creating this database. If createMode is not Default, this * value is ignored. Not supported for DataWarehouse edition. Possible values * include: 'AdventureWorksLT' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. */ constructor() { super(); @@ -416,6 +438,13 @@ class DatabaseUpdate extends models['Resource'] { type: { name: 'String' } + }, + zoneRedundant: { + required: false, + serializedName: 'properties.zoneRedundant', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/editionCapability.js b/lib/services/sqlManagement2/lib/models/editionCapability.js index c7454e9524..39b5d2959b 100644 --- a/lib/services/sqlManagement2/lib/models/editionCapability.js +++ b/lib/services/sqlManagement2/lib/models/editionCapability.js @@ -24,6 +24,8 @@ class EditionCapability { * include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedServiceLevelObjectives] The list of supported * service objectives for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. */ constructor() { } @@ -74,6 +76,14 @@ class EditionCapability { } } } + }, + zoneRedundant: { + required: false, + readOnly: true, + serializedName: 'zoneRedundant', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/elasticPool.js b/lib/services/sqlManagement2/lib/models/elasticPool.js index f8179f7308..71a027af35 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPool.js +++ b/lib/services/sqlManagement2/lib/models/elasticPool.js @@ -33,6 +33,9 @@ class ElasticPool extends models['TrackedResource'] { * guaranteed. * @member {number} [storageMB] Gets storage limit for the database elastic * pool in MB. + * @member {boolean} [zoneRedundant] Whether or not this database elastic + * pool is zone redundant, which means the replicas of this database will be + * spread across multiple availability zones. * @member {string} [kind] Kind of elastic pool. This is metadata used for * the Azure portal experience. */ @@ -150,6 +153,13 @@ class ElasticPool extends models['TrackedResource'] { name: 'Number' } }, + zoneRedundant: { + required: false, + serializedName: 'properties.zoneRedundant', + type: { + name: 'Boolean' + } + }, kind: { required: false, readOnly: true, diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js b/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js index 7a4577b25b..72a2d06bbc 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js @@ -24,6 +24,8 @@ class ElasticPoolEditionCapability { * values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedElasticPoolDtus] The list of supported elastic * pool DTU levels for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. */ constructor() { } @@ -74,6 +76,14 @@ class ElasticPoolEditionCapability { } } } + }, + zoneRedundant: { + required: false, + readOnly: true, + serializedName: 'zoneRedundant', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolOperation.js b/lib/services/sqlManagement2/lib/models/elasticPoolOperation.js new file mode 100644 index 0000000000..3a9d43357b --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolOperation.js @@ -0,0 +1,201 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A elastic pool operation. + * + * @extends models['ProxyResource'] + */ +class ElasticPoolOperation extends models['ProxyResource'] { + /** + * Create a ElasticPoolOperation. + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ElasticPoolOperation + * + * @returns {object} metadata of ElasticPoolOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolOperation', + type: { + name: 'Composite', + className: 'ElasticPoolOperation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + elasticPoolName: { + required: false, + readOnly: true, + serializedName: 'properties.elasticPoolName', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'properties.operation', + type: { + name: 'String' + } + }, + operationFriendlyName: { + required: false, + readOnly: true, + serializedName: 'properties.operationFriendlyName', + type: { + name: 'String' + } + }, + percentComplete: { + required: false, + readOnly: true, + serializedName: 'properties.percentComplete', + type: { + name: 'Number' + } + }, + serverName: { + required: false, + readOnly: true, + serializedName: 'properties.serverName', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + errorCode: { + required: false, + readOnly: true, + serializedName: 'properties.errorCode', + type: { + name: 'Number' + } + }, + errorDescription: { + required: false, + readOnly: true, + serializedName: 'properties.errorDescription', + type: { + name: 'String' + } + }, + errorSeverity: { + required: false, + readOnly: true, + serializedName: 'properties.errorSeverity', + type: { + name: 'Number' + } + }, + isUserError: { + required: false, + readOnly: true, + serializedName: 'properties.isUserError', + type: { + name: 'Boolean' + } + }, + estimatedCompletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.estimatedCompletionTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + isCancellable: { + required: false, + readOnly: true, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolOperation; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js b/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js new file mode 100644 index 0000000000..c389d12c01 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js @@ -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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response to a list elastic pool operations request + */ +class ElasticPoolOperationListResult extends Array { + /** + * Create a ElasticPoolOperationListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ElasticPoolOperationListResult + * + * @returns {object} metadata of ElasticPoolOperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolOperationListResult', + type: { + name: 'Composite', + className: 'ElasticPoolOperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ElasticPoolOperationElementType', + type: { + name: 'Composite', + className: 'ElasticPoolOperation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolOperationListResult; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js b/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js index 8b1fbfa17b..c1de004d29 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js @@ -34,6 +34,9 @@ class ElasticPoolUpdate extends models['Resource'] { * guaranteed. * @member {number} [storageMB] Gets storage limit for the database elastic * pool in MB. + * @member {boolean} [zoneRedundant] Whether or not this database elastic + * pool is zone redundant, which means the replicas of this database will be + * spread across multiple availability zones. */ constructor() { super(); @@ -141,6 +144,13 @@ class ElasticPoolUpdate extends models['Resource'] { type: { name: 'Number' } + }, + zoneRedundant: { + required: false, + serializedName: 'properties.zoneRedundant', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/importRequest.js b/lib/services/sqlManagement2/lib/models/importRequest.js index a418f5129e..474fc662c8 100644 --- a/lib/services/sqlManagement2/lib/models/importRequest.js +++ b/lib/services/sqlManagement2/lib/models/importRequest.js @@ -23,11 +23,18 @@ class ImportRequest extends models['ExportRequest'] { * @member {string} databaseName The name of the database to import. * @member {string} edition The edition for the database being created. * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * @member {string} serviceObjectiveName The name of the service objective to - * assign to the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', + * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', + * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', + * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', + * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {string} maxSizeBytes The maximum size for the newly imported * database. */ diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index f39d5dc536..8809868c22 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -32,49 +32,6 @@ export interface Resource extends BaseResource { readonly type?: string; } -/** - * @class - * Initializes a new instance of the ProxyResource class. - * @constructor - * ARM proxy resource. - * - */ -export interface ProxyResource extends Resource { -} - -/** - * @class - * Initializes a new instance of the BackupLongTermRetentionPolicy class. - * @constructor - * A backup long term retention policy - * - * @member {string} [location] The geo-location where the resource lives - * @member {string} state The status of the backup long term retention policy. - * Possible values include: 'Disabled', 'Enabled' - * @member {string} recoveryServicesBackupPolicyResourceId The azure recovery - * services backup protection policy resource id - */ -export interface BackupLongTermRetentionPolicy extends ProxyResource { - readonly location?: string; - state: string; - recoveryServicesBackupPolicyResourceId: string; -} - -/** - * @class - * Initializes a new instance of the BackupLongTermRetentionVault class. - * @constructor - * A backup long term retention vault - * - * @member {string} [location] The geo-location where the resource lives - * @member {string} recoveryServicesVaultResourceId The azure recovery services - * vault resource id - */ -export interface BackupLongTermRetentionVault extends ProxyResource { - readonly location?: string; - recoveryServicesVaultResourceId: string; -} - /** * @class * Initializes a new instance of the TrackedResource class. @@ -91,22 +48,12 @@ export interface TrackedResource extends Resource { /** * @class - * Initializes a new instance of the RestorePoint class. + * Initializes a new instance of the ProxyResource class. * @constructor - * A database restore point. + * ARM proxy resource. * - * @member {string} [restorePointType] The restore point type of the database - * restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' - * @member {date} [restorePointCreationDate] Restore point creation time - * (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null - * otherwise. - * @member {date} [earliestRestoreDate] Earliest restore time (ISO8601 format). - * Populated when restorePointType = DISCRETE. Null otherwise. */ -export interface RestorePoint extends ProxyResource { - readonly restorePointType?: string; - readonly restorePointCreationDate?: Date; - readonly earliestRestoreDate?: Date; +export interface ProxyResource extends Resource { } /** @@ -227,11 +174,14 @@ export interface ServiceObjectiveCapability { * include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedServiceLevelObjectives] The list of supported * service objectives for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. */ export interface EditionCapability { readonly name?: string; readonly status?: string; readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; + readonly zoneRedundant?: boolean; } /** @@ -316,11 +266,14 @@ export interface ElasticPoolDtuCapability { * values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedElasticPoolDtus] The list of supported elastic * pool DTU levels for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. */ export interface ElasticPoolEditionCapability { readonly name?: string; readonly status?: string; readonly supportedElasticPoolDtus?: ElasticPoolDtuCapability[]; + readonly zoneRedundant?: boolean; } /** @@ -361,6 +314,41 @@ export interface LocationCapabilities { readonly supportedServerVersions?: ServerVersionCapability[]; } +/** + * @class + * Initializes a new instance of the CheckNameAvailabilityRequest class. + * @constructor + * A request to check whether the specified name for a resource is available. + * + * @member {string} name The name whose availability is to be checked. + */ +export interface CheckNameAvailabilityRequest { + name: string; +} + +/** + * @class + * Initializes a new instance of the CheckNameAvailabilityResponse class. + * @constructor + * A response indicating whether the specified name for a resource is + * available. + * + * @member {boolean} [available] True if the name is available, otherwise + * false. + * @member {string} [message] A message explaining why the name is unavailable. + * Will be null if the name is available. + * @member {string} [name] The name whose availability was checked. + * @member {string} [reason] The reason code explaining why the name is + * unavailable. Will be null if the name is available. Possible values include: + * 'Invalid', 'AlreadyExists' + */ +export interface CheckNameAvailabilityResponse { + readonly available?: boolean; + readonly message?: string; + readonly name?: string; + readonly reason?: string; +} + /** * @class * Initializes a new instance of the ServerConnectionPolicy class. @@ -380,1267 +368,1296 @@ export interface ServerConnectionPolicy extends ProxyResource { /** * @class - * Initializes a new instance of the DatabaseSecurityAlertPolicy class. + * Initializes a new instance of the SloUsageMetric class. * @constructor - * Contains information about a database Threat Detection policy. + * A Slo Usage Metric. * - * @member {string} [location] The geo-location where the resource lives - * @member {string} [kind] Resource kind. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'New', 'Enabled', 'Disabled' - * @member {string} [disabledAlerts] Specifies the semicolon-separated list of - * alerts that are disabled, or empty string to disable no alerts. Possible - * values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; - * Usage_Anomaly. - * @member {string} [emailAddresses] Specifies the semicolon-separated list of - * e-mail addresses to which the alert is sent. - * @member {string} [emailAccountAdmins] Specifies that the alert is sent to - * the account administrators. Possible values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). This blob storage will hold all - * Threat Detection audit logs. If state is Enabled, storageEndpoint is - * required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the Threat Detection audit storage account. If state is Enabled, - * storageAccountAccessKey is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * Threat Detection audit logs. - * @member {string} [useServerDefault] Specifies whether to use the default - * server policy. Possible values include: 'Enabled', 'Disabled' + * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO + * usage metric. Possible values include: 'System', 'System0', 'System1', + * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', + * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', + * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', + * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', + * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', + * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', + * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', + * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO + * usage metric. + * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO + * usage metric. */ -export interface DatabaseSecurityAlertPolicy extends ProxyResource { - location?: string; - readonly kind?: string; - state: string; - disabledAlerts?: string; - emailAddresses?: string; - emailAccountAdmins?: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - useServerDefault?: string; +export interface SloUsageMetric { + readonly serviceLevelObjective?: string; + readonly serviceLevelObjectiveId?: string; + readonly inRangeTimeRatio?: number; } /** * @class - * Initializes a new instance of the DataMaskingPolicy class. + * Initializes a new instance of the ServiceTierAdvisor class. * @constructor - * Represents a database data masking policy. + * Represents a Service Tier Advisor. * - * @member {string} dataMaskingState The state of the data masking policy. - * Possible values include: 'Disabled', 'Enabled' - * @member {string} [exemptPrincipals] The list of the exempt principals. - * Specifies the semicolon-separated list of database users for which the data - * masking policy does not apply. The specified users receive data results - * without masking for all of the database queries. - * @member {string} [applicationPrincipals] The list of the application - * principals. This is a legacy parameter and is no longer used. - * @member {string} [maskingLevel] The masking level. This is a legacy - * parameter and is no longer used. - * @member {string} [location] The location of the data masking policy. - * @member {string} [kind] The kind of data masking policy. Metadata, used for - * Azure portal. + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 + * format). + * @member {number} [activeTimeRatio] The activeTimeRatio for service tier + * advisor. + * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. + * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. + * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. + * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier + * advisor. + * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets + * serviceLevelObjectiveUsageMetrics for the service tier advisor. + * @member {string} [currentServiceLevelObjective] Gets or sets + * currentServiceLevelObjective for service tier advisor. + * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets + * currentServiceLevelObjectiveId for service tier advisor. + * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or + * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or + * sets usageBasedRecommendationServiceLevelObjectiveId for service tier + * advisor. + * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets + * overallRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets + * overallRecommendationServiceLevelObjectiveId for service tier advisor. + * @member {number} [confidence] Gets or sets confidence for service tier + * advisor. */ -export interface DataMaskingPolicy extends ProxyResource { - dataMaskingState: string; - exemptPrincipals?: string; - readonly applicationPrincipals?: string; - readonly maskingLevel?: string; - readonly location?: string; - readonly kind?: string; +export interface ServiceTierAdvisor extends ProxyResource { + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly activeTimeRatio?: number; + readonly minDtu?: number; + readonly avgDtu?: number; + readonly maxDtu?: number; + readonly maxSizeInGB?: number; + readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; + readonly currentServiceLevelObjective?: string; + readonly currentServiceLevelObjectiveId?: string; + readonly usageBasedRecommendationServiceLevelObjective?: string; + readonly usageBasedRecommendationServiceLevelObjectiveId?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; + readonly overallRecommendationServiceLevelObjective?: string; + readonly overallRecommendationServiceLevelObjectiveId?: string; + readonly confidence?: number; } /** * @class - * Initializes a new instance of the DataMaskingRule class. + * Initializes a new instance of the TransparentDataEncryption class. * @constructor - * Represents a database data masking rule. + * Represents a database transparent data encryption configuration. * - * @member {string} [dataMaskingRuleId] The rule Id. - * @member {string} [aliasName] The alias name. This is a legacy parameter and - * is no longer used. - * @member {string} [ruleState] The rule state. Used to delete a rule. To - * delete an existing rule, specify the schemaName, tableName, columnName, - * maskingFunction, and specify ruleState as disabled. However, if the rule - * doesn't already exist, the rule will be created with ruleState set to - * enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * @member {string} schemaName The schema name on which the data masking rule - * is applied. - * @member {string} tableName The table name on which the data masking rule is - * applied. - * @member {string} columnName The column name on which the data masking rule - * is applied. - * @member {string} maskingFunction The masking function that is used for the - * data masking rule. Possible values include: 'Default', 'CCN', 'Email', - * 'Number', 'SSN', 'Text' - * @member {string} [numberFrom] The numberFrom property of the masking rule. - * Required if maskingFunction is set to Number, otherwise this parameter will - * be ignored. - * @member {string} [numberTo] The numberTo property of the data masking rule. - * Required if maskingFunction is set to Number, otherwise this parameter will - * be ignored. - * @member {string} [prefixSize] If maskingFunction is set to Text, the number - * of characters to show unmasked in the beginning of the string. Otherwise, - * this parameter will be ignored. - * @member {string} [suffixSize] If maskingFunction is set to Text, the number - * of characters to show unmasked at the end of the string. Otherwise, this - * parameter will be ignored. - * @member {string} [replacementString] If maskingFunction is set to Text, the - * character to use for masking the unexposed part of the string. Otherwise, - * this parameter will be ignored. - * @member {string} [location] The location of the data masking rule. - * @member {string} [kind] The kind of Data Masking Rule. Metadata, used for - * Azure portal. + * @member {string} [location] Resource location. + * @member {string} [status] The status of the database transparent data + * encryption. Possible values include: 'Enabled', 'Disabled' */ -export interface DataMaskingRule extends ProxyResource { - readonly dataMaskingRuleId?: string; - aliasName?: string; - ruleState?: string; - schemaName: string; - tableName: string; - columnName: string; - maskingFunction: string; - numberFrom?: string; - numberTo?: string; - prefixSize?: string; - suffixSize?: string; - replacementString?: string; +export interface TransparentDataEncryption extends ProxyResource { readonly location?: string; - readonly kind?: string; + status?: string; } /** * @class - * Initializes a new instance of the FirewallRule class. + * Initializes a new instance of the OperationImpact class. * @constructor - * Represents a server firewall rule. + * The impact of an operation, both in absolute and relative terms. * - * @member {string} [kind] Kind of server that contains this firewall rule. - * @member {string} [location] Location of the server that contains this - * firewall rule. - * @member {string} startIpAddress The start IP address of the firewall rule. - * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP - * addresses. - * @member {string} endIpAddress The end IP address of the firewall rule. Must - * be IPv4 format. Must be greater than or equal to startIpAddress. Use value - * '0.0.0.0' to represent all Azure-internal IP addresses. + * @member {string} [name] The name of the impact dimension. + * @member {string} [unit] The unit in which estimated impact to dimension is + * measured. + * @member {number} [changeValueAbsolute] The absolute impact to dimension. + * @member {number} [changeValueRelative] The relative impact to dimension + * (null if not applicable) */ -export interface FirewallRule extends ProxyResource { - readonly kind?: string; - readonly location?: string; - startIpAddress: string; - endIpAddress: string; +export interface OperationImpact { + readonly name?: string; + readonly unit?: string; + readonly changeValueAbsolute?: number; + readonly changeValueRelative?: number; } /** * @class - * Initializes a new instance of the GeoBackupPolicy class. + * Initializes a new instance of the RecommendedIndex class. * @constructor - * A database geo backup policy. + * Represents a database recommended index. * - * @member {string} state The state of the geo backup policy. Possible values - * include: 'Disabled', 'Enabled' - * @member {string} [storageType] The storage type of the geo backup policy. - * @member {string} [kind] Kind of geo backup policy. This is metadata used - * for the Azure portal experience. - * @member {string} [location] Backup policy location. + * @member {string} [action] The proposed index action. You can create a + * missing index, drop an unused index, or rebuild an existing index to improve + * its performance. Possible values include: 'Create', 'Drop', 'Rebuild' + * @member {string} [state] The current recommendation state. Possible values + * include: 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', + * 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' + * @member {date} [created] The UTC datetime showing when this resource was + * created (ISO8601 format). + * @member {date} [lastModified] The UTC datetime of when was this resource + * last changed (ISO8601 format). + * @member {string} [indexType] The type of index (CLUSTERED, NONCLUSTERED, + * COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', + * 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' + * @member {string} [schema] The schema where table to build index over resides + * @member {string} [table] The table on which to build index. + * @member {array} [columns] Columns over which to build index + * @member {array} [includedColumns] The list of column names to be included in + * the index + * @member {string} [indexScript] The full build index script + * @member {array} [estimatedImpact] The estimated impact of doing recommended + * index action. + * @member {array} [reportedImpact] The values reported after index action is + * complete. */ -export interface GeoBackupPolicy extends ProxyResource { - state: string; - readonly storageType?: string; - readonly kind?: string; - readonly location?: string; +export interface RecommendedIndex extends ProxyResource { + readonly action?: string; + readonly state?: string; + readonly created?: Date; + readonly lastModified?: Date; + readonly indexType?: string; + readonly schema?: string; + readonly table?: string; + readonly columns?: string[]; + readonly includedColumns?: string[]; + readonly indexScript?: string; + readonly estimatedImpact?: OperationImpact[]; + readonly reportedImpact?: OperationImpact[]; } /** * @class - * Initializes a new instance of the ImportExtensionRequest class. + * Initializes a new instance of the Database class. * @constructor - * Import database parameters. + * Represents a database. * - * @member {string} [name] The name of the extension. - * @member {string} [type] The type of the extension. - * @member {string} storageKeyType The type of the storage key to use. Possible - * values include: 'StorageAccessKey', 'SharedAccessKey' - * @member {string} storageKey The storage key to use. If storage key type is - * SharedAccessKey, it must be preceded with a "?." - * @member {string} storageUri The storage uri to use. - * @member {string} administratorLogin The name of the SQL administrator. - * @member {string} administratorLoginPassword The password of the SQL - * administrator. - * @member {string} [authenticationType] The authentication type. Possible - * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . - */ -export interface ImportExtensionRequest { - name?: string; - type?: string; - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; -} - -/** - * @class - * Initializes a new instance of the ImportExportResponse class. - * @constructor - * Response for Import/Export Get operation. + * @member {string} [kind] Kind of database. This is metadata used for the + * Azure portal experience. + * @member {string} [collation] The collation of the database. If createMode is + * not Default, this value is ignored. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {number} [containmentState] The containment state of the database. + * @member {uuid} [currentServiceObjectiveId] The current service level + * objective ID of the database. This is the ID of the service level objective + * that is currently active. + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [createMode] Specifies the mode of database creation. * - * @member {string} [requestType] The request type of the operation. - * @member {uuid} [requestId] The request type of the operation. - * @member {string} [serverName] The name of the server. - * @member {string} [databaseName] The name of the database. - * @member {string} [status] The status message returned from the server. - * @member {string} [lastModifiedTime] The operation status last modified time. - * @member {string} [queuedTime] The operation queued time. - * @member {string} [blobUri] The blob uri. - * @member {string} [errorMessage] The error message returned from the server. - */ -export interface ImportExportResponse extends ProxyResource { - readonly requestType?: string; - readonly requestId?: string; - readonly serverName?: string; - readonly databaseName?: string; - readonly status?: string; - readonly lastModifiedTime?: string; - readonly queuedTime?: string; - readonly blobUri?: string; - readonly errorMessage?: string; -} - -/** - * @class - * Initializes a new instance of the ExportRequest class. - * @constructor - * Export database parameters. + * Default: regular database creation. * - * @member {string} storageKeyType The type of the storage key to use. Possible - * values include: 'StorageAccessKey', 'SharedAccessKey' - * @member {string} storageKey The storage key to use. If storage key type is - * SharedAccessKey, it must be preceded with a "?." - * @member {string} storageUri The storage uri to use. - * @member {string} administratorLogin The name of the SQL administrator. - * @member {string} administratorLoginPassword The password of the SQL - * administrator. - * @member {string} [authenticationType] The authentication type. Possible - * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . - */ -export interface ExportRequest { - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; -} - -/** - * @class - * Initializes a new instance of the ImportRequest class. - * @constructor - * Import database parameters. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @member {string} databaseName The name of the database to import. - * @member {string} edition The edition for the database being created. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} serviceObjectiveName The name of the service objective to - * assign to the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', - * 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {string} maxSizeBytes The maximum size for the newly imported - * database. - */ -export interface ImportRequest extends ExportRequest { - databaseName: string; - edition: string; - serviceObjectiveName: string; - maxSizeBytes: string; -} - -/** - * @class - * Initializes a new instance of the MetricValue class. - * @constructor - * Represents database metrics. + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @member {number} [count] The number of values for the metric. - * @member {number} [average] The average value of the metric. - * @member {number} [maximum] The max value of the metric. - * @member {number} [minimum] The min value of the metric. - * @member {date} [timestamp] The metric timestamp (ISO-8601 format). - * @member {number} [total] The total value of the metric. - */ -export interface MetricValue { - readonly count?: number; - readonly average?: number; - readonly maximum?: number; - readonly minimum?: number; - readonly timestamp?: Date; - readonly total?: number; -} - -/** - * @class - * Initializes a new instance of the MetricName class. - * @constructor - * A database metric name. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @member {string} [value] The name of the database metric. - * @member {string} [localizedValue] The friendly name of the database metric. - */ -export interface MetricName { - readonly value?: string; - readonly localizedValue?: string; -} - -/** - * @class - * Initializes a new instance of the Metric class. - * @constructor - * Database metrics. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @member {date} [startTime] The start time for the metric (ISO-8601 format). - * @member {date} [endTime] The end time for the metric (ISO-8601 format). - * @member {string} [timeGrain] The time step to be used to summarize the - * metric values. - * @member {string} [unit] The unit of the metric. Possible values include: - * 'count', 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' - * @member {object} [name] The name information for the metric. - * @member {string} [name.value] The name of the database metric. - * @member {string} [name.localizedValue] The friendly name of the database - * metric. - * @member {array} [metricValues] The metric values for the specified time - * window and timestep. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, + * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or + * Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is + * Restore and sourceDatabaseId is the deleted database's original resource id + * when it existed (as opposed to its current restorable dropped database id), + * then this value is required. Specifies the time that the database was + * deleted. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If + * createMode is RestoreLongTermRetentionBackup, then this value is required. + * Specifies the resource ID of the recovery point to restore from. + * @member {string} [edition] The edition of the database. The DatabaseEditions + * enumeration contains all the valid editions. If createMode is + * NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @member {string} [maxSizeBytes] The max size of the database expressed in + * bytes. If createMode is not Default, this value is ignored. To see possible + * values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * @member {uuid} [requestedServiceObjectiveId] The configured service level + * objective ID of the database. This is the service level objective that is in + * the process of being applied to the database. Once successfully updated, it + * will match the value of currentServiceObjectiveId property. If + * requestedServiceObjectiveId and requestedServiceObjectiveName are both + * updated, the value of requestedServiceObjectiveId overrides the value of + * requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * @member {string} [requestedServiceObjectiveName] The name of the configured + * service level objective of the database. This is the service level objective + * that is in the process of being applied to the database. Once successfully + * updated, it will match the value of serviceLevelObjective property. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * @member {string} [serviceLevelObjective] The current service level objective + * of the database. Possible values include: 'System', 'System0', 'System1', + * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', + * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', + * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', + * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', + * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', + * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', + * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', + * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {string} [status] The status of the database. + * @member {string} [elasticPoolName] The name of the elastic pool the database + * is in. If elasticPoolName and requestedServiceObjectiveName are both + * updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * @member {string} [defaultSecondaryLocation] The default secondary region for + * this database. + * @member {array} [serviceTierAdvisors] The list of service tier advisors for + * this database. Expanded property + * @member {array} [transparentDataEncryption] The transparent data encryption + * info for this database. + * @member {array} [recommendedIndex] The recommended indices for this + * database. + * @member {string} [failoverGroupId] The resource identifier of the failover + * group containing this database. + * @member {string} [readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * @member {string} [sampleName] Indicates the name of the sample schema to + * apply when creating this database. If createMode is not Default, this value + * is ignored. Not supported for DataWarehouse edition. Possible values + * include: 'AdventureWorksLT' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. */ -export interface Metric { - readonly startTime?: Date; - readonly endTime?: Date; - readonly timeGrain?: string; - readonly unit?: string; - readonly name?: MetricName; - readonly metricValues?: MetricValue[]; +export interface Database extends TrackedResource { + readonly kind?: string; + collation?: string; + readonly creationDate?: Date; + readonly containmentState?: number; + readonly currentServiceObjectiveId?: string; + readonly databaseId?: string; + readonly earliestRestoreDate?: Date; + createMode?: string; + sourceDatabaseId?: string; + sourceDatabaseDeletionDate?: Date; + restorePointInTime?: Date; + recoveryServicesRecoveryPointResourceId?: string; + edition?: string; + maxSizeBytes?: string; + requestedServiceObjectiveId?: string; + requestedServiceObjectiveName?: string; + readonly serviceLevelObjective?: string; + readonly status?: string; + elasticPoolName?: string; + readonly defaultSecondaryLocation?: string; + readonly serviceTierAdvisors?: ServiceTierAdvisor[]; + readonly transparentDataEncryption?: TransparentDataEncryption[]; + readonly recommendedIndex?: RecommendedIndex[]; + readonly failoverGroupId?: string; + readScale?: string; + sampleName?: string; + zoneRedundant?: boolean; } /** * @class - * Initializes a new instance of the MetricAvailability class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * A metric availability value. + * Represents a database update. * - * @member {string} [retention] The length of retention for the database - * metric. - * @member {string} [timeGrain] The granularity of the database metric. + * @member {object} [tags] Resource tags. + * @member {string} [collation] The collation of the database. If createMode is + * not Default, this value is ignored. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {number} [containmentState] The containment state of the database. + * @member {uuid} [currentServiceObjectiveId] The current service level + * objective ID of the database. This is the ID of the service level objective + * that is currently active. + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [createMode] Specifies the mode of database creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, + * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or + * Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is + * Restore and sourceDatabaseId is the deleted database's original resource id + * when it existed (as opposed to its current restorable dropped database id), + * then this value is required. Specifies the time that the database was + * deleted. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If + * createMode is RestoreLongTermRetentionBackup, then this value is required. + * Specifies the resource ID of the recovery point to restore from. + * @member {string} [edition] The edition of the database. The DatabaseEditions + * enumeration contains all the valid editions. If createMode is + * NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @member {string} [maxSizeBytes] The max size of the database expressed in + * bytes. If createMode is not Default, this value is ignored. To see possible + * values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * @member {uuid} [requestedServiceObjectiveId] The configured service level + * objective ID of the database. This is the service level objective that is in + * the process of being applied to the database. Once successfully updated, it + * will match the value of currentServiceObjectiveId property. If + * requestedServiceObjectiveId and requestedServiceObjectiveName are both + * updated, the value of requestedServiceObjectiveId overrides the value of + * requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * @member {string} [requestedServiceObjectiveName] The name of the configured + * service level objective of the database. This is the service level objective + * that is in the process of being applied to the database. Once successfully + * updated, it will match the value of serviceLevelObjective property. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * @member {string} [serviceLevelObjective] The current service level objective + * of the database. Possible values include: 'System', 'System0', 'System1', + * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', + * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', + * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', + * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', + * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', + * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', + * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', + * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {string} [status] The status of the database. + * @member {string} [elasticPoolName] The name of the elastic pool the database + * is in. If elasticPoolName and requestedServiceObjectiveName are both + * updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * @member {string} [defaultSecondaryLocation] The default secondary region for + * this database. + * @member {array} [serviceTierAdvisors] The list of service tier advisors for + * this database. Expanded property + * @member {array} [transparentDataEncryption] The transparent data encryption + * info for this database. + * @member {array} [recommendedIndex] The recommended indices for this + * database. + * @member {string} [failoverGroupId] The resource identifier of the failover + * group containing this database. + * @member {string} [readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * @member {string} [sampleName] Indicates the name of the sample schema to + * apply when creating this database. If createMode is not Default, this value + * is ignored. Not supported for DataWarehouse edition. Possible values + * include: 'AdventureWorksLT' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. */ -export interface MetricAvailability { - readonly retention?: string; - readonly timeGrain?: string; +export interface DatabaseUpdate extends Resource { + tags?: { [propertyName: string]: string }; + collation?: string; + readonly creationDate?: Date; + readonly containmentState?: number; + readonly currentServiceObjectiveId?: string; + readonly databaseId?: string; + readonly earliestRestoreDate?: Date; + createMode?: string; + sourceDatabaseId?: string; + sourceDatabaseDeletionDate?: Date; + restorePointInTime?: Date; + recoveryServicesRecoveryPointResourceId?: string; + edition?: string; + maxSizeBytes?: string; + requestedServiceObjectiveId?: string; + requestedServiceObjectiveName?: string; + readonly serviceLevelObjective?: string; + readonly status?: string; + elasticPoolName?: string; + readonly defaultSecondaryLocation?: string; + readonly serviceTierAdvisors?: ServiceTierAdvisor[]; + readonly transparentDataEncryption?: TransparentDataEncryption[]; + readonly recommendedIndex?: RecommendedIndex[]; + readonly failoverGroupId?: string; + readScale?: string; + sampleName?: string; + zoneRedundant?: boolean; +} + +/** + * @class + * Initializes a new instance of the TransparentDataEncryptionActivity class. + * @constructor + * Represents a database transparent data encryption Scan. + * + * @member {string} [location] Resource location. + * @member {string} [status] The status of the database. Possible values + * include: 'Encrypting', 'Decrypting' + * @member {number} [percentComplete] The percent complete of the transparent + * data encryption scan for a database. + */ +export interface TransparentDataEncryptionActivity extends ProxyResource { + readonly location?: string; + readonly status?: string; + readonly percentComplete?: number; } /** * @class - * Initializes a new instance of the MetricDefinition class. + * Initializes a new instance of the ElasticPoolDatabaseActivity class. * @constructor - * A database metric definition. + * Represents the activity on an elastic pool. * - * @member {object} [name] The name information for the metric. - * @member {string} [name.value] The name of the database metric. - * @member {string} [name.localizedValue] The friendly name of the database - * metric. - * @member {string} [primaryAggregationType] The primary aggregation type - * defining how metric values are displayed. Possible values include: 'None', - * 'Average', 'Count', 'Minimum', 'Maximum', 'Total' - * @member {string} [resourceUri] The resource uri of the database. - * @member {string} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - * @member {array} [metricAvailabilities] The list of database metric - * availabities for the metric. + * @member {string} [location] The geo-location where the resource lives + * @member {string} [databaseName] The database name. + * @member {date} [endTime] The time the operation finished (ISO8601 format). + * @member {number} [errorCode] The error code if available. + * @member {string} [errorMessage] The error message if available. + * @member {number} [errorSeverity] The error severity if available. + * @member {string} [operation] The operation name. + * @member {uuid} [operationId] The unique operation ID. + * @member {number} [percentComplete] The percentage complete if available. + * @member {string} [requestedElasticPoolName] The name for the elastic pool + * the database is moving into if available. + * @member {string} [currentElasticPoolName] The name of the current elastic + * pool the database is in if available. + * @member {string} [currentServiceObjective] The name of the current service + * objective if available. + * @member {string} [requestedServiceObjective] The name of the requested + * service objective if available. + * @member {string} [serverName] The name of the server the elastic pool is in. + * @member {date} [startTime] The time the operation started (ISO8601 format). + * @member {string} [state] The current state of the operation. */ -export interface MetricDefinition { - readonly name?: MetricName; - readonly primaryAggregationType?: string; - readonly resourceUri?: string; - readonly unit?: string; - readonly metricAvailabilities?: MetricAvailability[]; +export interface ElasticPoolDatabaseActivity extends ProxyResource { + location?: string; + readonly databaseName?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; + readonly percentComplete?: number; + readonly requestedElasticPoolName?: string; + readonly currentElasticPoolName?: string; + readonly currentServiceObjective?: string; + readonly requestedServiceObjective?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; } /** * @class - * Initializes a new instance of the ReplicationLink class. + * Initializes a new instance of the ElasticPoolActivity class. * @constructor - * Represents a database replication link. + * Represents the activity on an elastic pool. * - * @member {string} [location] Location of the server that contains this - * firewall rule. - * @member {boolean} [isTerminationAllowed] Legacy value indicating whether - * termination is allowed. Currently always returns true. - * @member {string} [replicationMode] Replication mode of this replication - * link. - * @member {string} [partnerServer] The name of the server hosting the partner - * database. - * @member {string} [partnerDatabase] The name of the partner database. - * @member {string} [partnerLocation] The Azure Region of the partner database. - * @member {string} [role] The role of the database in the replication link. - * Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', - * 'Source', 'Copy' - * @member {string} [partnerRole] The role of the partner database in the - * replication link. Possible values include: 'Primary', 'Secondary', - * 'NonReadableSecondary', 'Source', 'Copy' - * @member {date} [startTime] The start time for the replication link. - * @member {number} [percentComplete] The percentage of seeding complete for - * the replication link. - * @member {string} [replicationState] The replication state for the - * replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', - * 'SUSPENDED' + * @member {string} [location] The geo-location where the resource lives + * @member {date} [endTime] The time the operation finished (ISO8601 format). + * @member {number} [errorCode] The error code if available. + * @member {string} [errorMessage] The error message if available. + * @member {number} [errorSeverity] The error severity if available. + * @member {string} [operation] The operation name. + * @member {uuid} [operationId] The unique operation ID. + * @member {number} [percentComplete] The percentage complete if available. + * @member {number} [requestedDatabaseDtuMax] The requested max DTU per + * database if available. + * @member {number} [requestedDatabaseDtuMin] The requested min DTU per + * database if available. + * @member {number} [requestedDtu] The requested DTU for the pool if available. + * @member {string} [requestedElasticPoolName] The requested name for the + * elastic pool if available. + * @member {number} [requestedStorageLimitInGB] The requested storage limit for + * the pool in GB if available. + * @member {string} [elasticPoolName] The name of the elastic pool. + * @member {string} [serverName] The name of the server the elastic pool is in. + * @member {date} [startTime] The time the operation started (ISO8601 format). + * @member {string} [state] The current state of the operation. + * @member {number} [requestedStorageLimitInMB] The requested storage limit in + * MB. + * @member {number} [requestedDatabaseDtuGuarantee] The requested per database + * DTU guarantee. + * @member {number} [requestedDatabaseDtuCap] The requested per database DTU + * cap. + * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. */ -export interface ReplicationLink extends ProxyResource { - readonly location?: string; - readonly isTerminationAllowed?: boolean; - readonly replicationMode?: string; - readonly partnerServer?: string; - readonly partnerDatabase?: string; - readonly partnerLocation?: string; - readonly role?: string; - readonly partnerRole?: string; - readonly startTime?: Date; +export interface ElasticPoolActivity extends ProxyResource { + location?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; readonly percentComplete?: number; - readonly replicationState?: string; + readonly requestedDatabaseDtuMax?: number; + readonly requestedDatabaseDtuMin?: number; + readonly requestedDtu?: number; + readonly requestedElasticPoolName?: string; + readonly requestedStorageLimitInGB?: number; + readonly elasticPoolName?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly requestedStorageLimitInMB?: number; + readonly requestedDatabaseDtuGuarantee?: number; + readonly requestedDatabaseDtuCap?: number; + readonly requestedDtuGuarantee?: number; } /** * @class - * Initializes a new instance of the ServerAzureADAdministrator class. + * Initializes a new instance of the RecommendedElasticPoolMetric class. * @constructor - * An server Active Directory Administrator. + * Represents recommended elastic pool metric. * - * @member {string} login The server administrator login value. - * @member {uuid} sid The server administrator Sid (Secure ID). - * @member {uuid} tenantId The server Active Directory Administrator tenant id. + * @member {date} [dateTime] The time of metric (ISO8601 format). + * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). + * See + * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + * @member {number} [sizeGB] Gets or sets size in gigabytes. */ -export interface ServerAzureADAdministrator extends ProxyResource { - login: string; - sid: string; - tenantId: string; +export interface RecommendedElasticPoolMetric { + dateTime?: Date; + dtu?: number; + sizeGB?: number; } /** * @class - * Initializes a new instance of the ServerCommunicationLink class. + * Initializes a new instance of the RecommendedElasticPool class. * @constructor - * Server communication link. + * Represents a recommented elastic pool. * - * @member {string} [state] The state. - * @member {string} partnerServer The name of the partner server. - * @member {string} [location] Communication link location. - * @member {string} [kind] Communication link kind. This property is used for - * Azure Portal metadata. + * @member {string} [databaseEdition] The edition of the recommended elastic + * pool. The ElasticPoolEdition enumeration contains all the valid editions. + * Possible values include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The DTU for the recommended elastic pool. + * @member {number} [databaseDtuMin] The minimum DTU for the database. + * @member {number} [databaseDtuMax] The maximum DTU for the database. + * @member {number} [storageMB] Gets storage size in megabytes. + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 + * format). + * @member {number} [maxObservedDtu] Gets maximum observed DTU. + * @member {number} [maxObservedStorageMB] Gets maximum observed storage in + * megabytes. + * @member {array} [databases] The list of databases in this pool. Expanded + * property + * @member {array} [metrics] The list of databases housed in the server. + * Expanded property */ -export interface ServerCommunicationLink extends ProxyResource { - readonly state?: string; - partnerServer: string; - readonly location?: string; - readonly kind?: string; +export interface RecommendedElasticPool extends ProxyResource { + readonly databaseEdition?: string; + dtu?: number; + databaseDtuMin?: number; + databaseDtuMax?: number; + storageMB?: number; + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly maxObservedDtu?: number; + readonly maxObservedStorageMB?: number; + readonly databases?: Database[]; + readonly metrics?: RecommendedElasticPoolMetric[]; } /** * @class - * Initializes a new instance of the ServiceObjective class. + * Initializes a new instance of the DatabaseSecurityAlertPolicy class. * @constructor - * Represents a database service objective. + * Contains information about a database Threat Detection policy. * - * @member {string} [serviceObjectiveName] The name for the service objective. - * @member {boolean} [isDefault] Gets whether the service level objective is - * the default service objective. - * @member {boolean} [isSystem] Gets whether the service level objective is a - * system service objective. - * @member {string} [description] The description for the service level - * objective. - * @member {boolean} [enabled] Gets whether the service level objective is - * enabled. - */ -export interface ServiceObjective extends ProxyResource { - readonly serviceObjectiveName?: string; - readonly isDefault?: boolean; - readonly isSystem?: boolean; - readonly description?: string; - readonly enabled?: boolean; + * @member {string} [location] The geo-location where the resource lives + * @member {string} [kind] Resource kind. + * @member {string} state Specifies the state of the policy. If state is + * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible + * values include: 'New', 'Enabled', 'Disabled' + * @member {string} [disabledAlerts] Specifies the semicolon-separated list of + * alerts that are disabled, or empty string to disable no alerts. Possible + * values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; + * Usage_Anomaly. + * @member {string} [emailAddresses] Specifies the semicolon-separated list of + * e-mail addresses to which the alert is sent. + * @member {string} [emailAccountAdmins] Specifies that the alert is sent to + * the account administrators. Possible values include: 'Enabled', 'Disabled' + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all + * Threat Detection audit logs. If state is Enabled, storageEndpoint is + * required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the Threat Detection audit storage account. If state is Enabled, + * storageAccountAccessKey is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * Threat Detection audit logs. + * @member {string} [useServerDefault] Specifies whether to use the default + * server policy. Possible values include: 'Enabled', 'Disabled' + */ +export interface DatabaseSecurityAlertPolicy extends ProxyResource { + location?: string; + readonly kind?: string; + state: string; + disabledAlerts?: string; + emailAddresses?: string; + emailAccountAdmins?: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + useServerDefault?: string; } /** * @class - * Initializes a new instance of the CheckNameAvailabilityRequest class. + * Initializes a new instance of the DataMaskingPolicy class. * @constructor - * A request to check whether the specified name for a resource is available. + * Represents a database data masking policy. * - * @member {string} name The name whose availability is to be checked. + * @member {string} dataMaskingState The state of the data masking policy. + * Possible values include: 'Disabled', 'Enabled' + * @member {string} [exemptPrincipals] The list of the exempt principals. + * Specifies the semicolon-separated list of database users for which the data + * masking policy does not apply. The specified users receive data results + * without masking for all of the database queries. + * @member {string} [applicationPrincipals] The list of the application + * principals. This is a legacy parameter and is no longer used. + * @member {string} [maskingLevel] The masking level. This is a legacy + * parameter and is no longer used. + * @member {string} [location] The location of the data masking policy. + * @member {string} [kind] The kind of data masking policy. Metadata, used for + * Azure portal. */ -export interface CheckNameAvailabilityRequest { - name: string; +export interface DataMaskingPolicy extends ProxyResource { + dataMaskingState: string; + exemptPrincipals?: string; + readonly applicationPrincipals?: string; + readonly maskingLevel?: string; + readonly location?: string; + readonly kind?: string; } /** * @class - * Initializes a new instance of the CheckNameAvailabilityResponse class. + * Initializes a new instance of the DataMaskingRule class. * @constructor - * A response indicating whether the specified name for a resource is - * available. + * Represents a database data masking rule. * - * @member {boolean} [available] True if the name is available, otherwise - * false. - * @member {string} [message] A message explaining why the name is unavailable. - * Will be null if the name is available. - * @member {string} [name] The name whose availability was checked. - * @member {string} [reason] The reason code explaining why the name is - * unavailable. Will be null if the name is available. Possible values include: - * 'Invalid', 'AlreadyExists' + * @member {string} [dataMaskingRuleId] The rule Id. + * @member {string} [aliasName] The alias name. This is a legacy parameter and + * is no longer used. + * @member {string} [ruleState] The rule state. Used to delete a rule. To + * delete an existing rule, specify the schemaName, tableName, columnName, + * maskingFunction, and specify ruleState as disabled. However, if the rule + * doesn't already exist, the rule will be created with ruleState set to + * enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} schemaName The schema name on which the data masking rule + * is applied. + * @member {string} tableName The table name on which the data masking rule is + * applied. + * @member {string} columnName The column name on which the data masking rule + * is applied. + * @member {string} maskingFunction The masking function that is used for the + * data masking rule. Possible values include: 'Default', 'CCN', 'Email', + * 'Number', 'SSN', 'Text' + * @member {string} [numberFrom] The numberFrom property of the masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [numberTo] The numberTo property of the data masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [prefixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked in the beginning of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [suffixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked at the end of the string. Otherwise, this + * parameter will be ignored. + * @member {string} [replacementString] If maskingFunction is set to Text, the + * character to use for masking the unexposed part of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [location] The location of the data masking rule. + * @member {string} [kind] The kind of Data Masking Rule. Metadata, used for + * Azure portal. */ -export interface CheckNameAvailabilityResponse { - readonly available?: boolean; - readonly message?: string; - readonly name?: string; - readonly reason?: string; +export interface DataMaskingRule extends ProxyResource { + readonly dataMaskingRuleId?: string; + aliasName?: string; + ruleState?: string; + schemaName: string; + tableName: string; + columnName: string; + maskingFunction: string; + numberFrom?: string; + numberTo?: string; + prefixSize?: string; + suffixSize?: string; + replacementString?: string; + readonly location?: string; + readonly kind?: string; } /** * @class - * Initializes a new instance of the RecommendedElasticPoolMetric class. + * Initializes a new instance of the ElasticPool class. * @constructor - * Represents recommended elastic pool metric. + * Represents a database elastic pool. * - * @member {date} [dateTime] The time of metric (ISO8601 format). - * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). - * See - * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - * @member {number} [sizeGB] Gets or sets size in gigabytes. + * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * format). + * @member {string} [state] The state of the elastic pool. Possible values + * include: 'Creating', 'Ready', 'Disabled' + * @member {string} [edition] The edition of the elastic pool. Possible values + * include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The total shared DTU for the database elastic pool. + * @member {number} [databaseDtuMax] The maximum DTU any one database can + * consume. + * @member {number} [databaseDtuMin] The minimum DTU all databases are + * guaranteed. + * @member {number} [storageMB] Gets storage limit for the database elastic + * pool in MB. + * @member {boolean} [zoneRedundant] Whether or not this database elastic pool + * is zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * @member {string} [kind] Kind of elastic pool. This is metadata used for the + * Azure portal experience. */ -export interface RecommendedElasticPoolMetric { - dateTime?: Date; +export interface ElasticPool extends TrackedResource { + readonly creationDate?: Date; + readonly state?: string; + edition?: string; dtu?: number; - sizeGB?: number; + databaseDtuMax?: number; + databaseDtuMin?: number; + storageMB?: number; + zoneRedundant?: boolean; + readonly kind?: string; } /** * @class - * Initializes a new instance of the SloUsageMetric class. + * Initializes a new instance of the ElasticPoolUpdate class. * @constructor - * A Slo Usage Metric. + * Represents an elastic pool update. * - * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO - * usage metric. - * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO - * usage metric. + * @member {object} [tags] Resource tags. + * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * format). + * @member {string} [state] The state of the elastic pool. Possible values + * include: 'Creating', 'Ready', 'Disabled' + * @member {string} [edition] The edition of the elastic pool. Possible values + * include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The total shared DTU for the database elastic pool. + * @member {number} [databaseDtuMax] The maximum DTU any one database can + * consume. + * @member {number} [databaseDtuMin] The minimum DTU all databases are + * guaranteed. + * @member {number} [storageMB] Gets storage limit for the database elastic + * pool in MB. + * @member {boolean} [zoneRedundant] Whether or not this database elastic pool + * is zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. */ -export interface SloUsageMetric { - readonly serviceLevelObjective?: string; - readonly serviceLevelObjectiveId?: string; - readonly inRangeTimeRatio?: number; +export interface ElasticPoolUpdate extends Resource { + tags?: { [propertyName: string]: string }; + readonly creationDate?: Date; + readonly state?: string; + edition?: string; + dtu?: number; + databaseDtuMax?: number; + databaseDtuMin?: number; + storageMB?: number; + zoneRedundant?: boolean; } /** * @class - * Initializes a new instance of the ServiceTierAdvisor class. + * Initializes a new instance of the FirewallRule class. * @constructor - * Represents a Service Tier Advisor. + * Represents a server firewall rule. * - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [activeTimeRatio] The activeTimeRatio for service tier - * advisor. - * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. - * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. - * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. - * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier - * advisor. - * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets - * serviceLevelObjectiveUsageMetrics for the service tier advisor. - * @member {string} [currentServiceLevelObjective] Gets or sets - * currentServiceLevelObjective for service tier advisor. - * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets - * currentServiceLevelObjectiveId for service tier advisor. - * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or - * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or - * sets usageBasedRecommendationServiceLevelObjectiveId for service tier - * advisor. - * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets - * overallRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets - * overallRecommendationServiceLevelObjectiveId for service tier advisor. - * @member {number} [confidence] Gets or sets confidence for service tier - * advisor. + * @member {string} [kind] Kind of server that contains this firewall rule. + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {string} startIpAddress The start IP address of the firewall rule. + * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP + * addresses. + * @member {string} endIpAddress The end IP address of the firewall rule. Must + * be IPv4 format. Must be greater than or equal to startIpAddress. Use value + * '0.0.0.0' to represent all Azure-internal IP addresses. */ -export interface ServiceTierAdvisor extends ProxyResource { - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly activeTimeRatio?: number; - readonly minDtu?: number; - readonly avgDtu?: number; - readonly maxDtu?: number; - readonly maxSizeInGB?: number; - readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; - readonly currentServiceLevelObjective?: string; - readonly currentServiceLevelObjectiveId?: string; - readonly usageBasedRecommendationServiceLevelObjective?: string; - readonly usageBasedRecommendationServiceLevelObjectiveId?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; - readonly overallRecommendationServiceLevelObjective?: string; - readonly overallRecommendationServiceLevelObjectiveId?: string; - readonly confidence?: number; +export interface FirewallRule extends ProxyResource { + readonly kind?: string; + readonly location?: string; + startIpAddress: string; + endIpAddress: string; } /** * @class - * Initializes a new instance of the TransparentDataEncryption class. + * Initializes a new instance of the GeoBackupPolicy class. * @constructor - * Represents a database transparent data encryption configuration. + * A database geo backup policy. * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database transparent data - * encryption. Possible values include: 'Enabled', 'Disabled' + * @member {string} state The state of the geo backup policy. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} [storageType] The storage type of the geo backup policy. + * @member {string} [kind] Kind of geo backup policy. This is metadata used + * for the Azure portal experience. + * @member {string} [location] Backup policy location. */ -export interface TransparentDataEncryption extends ProxyResource { +export interface GeoBackupPolicy extends ProxyResource { + state: string; + readonly storageType?: string; + readonly kind?: string; readonly location?: string; - status?: string; } /** * @class - * Initializes a new instance of the OperationImpact class. + * Initializes a new instance of the ImportExtensionRequest class. * @constructor - * The impact of an operation, both in absolute and relative terms. + * Import database parameters. * - * @member {string} [name] The name of the impact dimension. - * @member {string} [unit] The unit in which estimated impact to dimension is - * measured. - * @member {number} [changeValueAbsolute] The absolute impact to dimension. - * @member {number} [changeValueRelative] The relative impact to dimension - * (null if not applicable) + * @member {string} [name] The name of the extension. + * @member {string} [type] The type of the extension. + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . */ -export interface OperationImpact { - readonly name?: string; - readonly unit?: string; - readonly changeValueAbsolute?: number; - readonly changeValueRelative?: number; +export interface ImportExtensionRequest { + name?: string; + type?: string; + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; } /** * @class - * Initializes a new instance of the RecommendedIndex class. + * Initializes a new instance of the ImportExportResponse class. * @constructor - * Represents a database recommended index. + * Response for Import/Export Get operation. * - * @member {string} [action] The proposed index action. You can create a - * missing index, drop an unused index, or rebuild an existing index to improve - * its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - * @member {string} [state] The current recommendation state. Possible values - * include: 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', - * 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - * @member {date} [created] The UTC datetime showing when this resource was - * created (ISO8601 format). - * @member {date} [lastModified] The UTC datetime of when was this resource - * last changed (ISO8601 format). - * @member {string} [indexType] The type of index (CLUSTERED, NONCLUSTERED, - * COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', - * 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' - * @member {string} [schema] The schema where table to build index over resides - * @member {string} [table] The table on which to build index. - * @member {array} [columns] Columns over which to build index - * @member {array} [includedColumns] The list of column names to be included in - * the index - * @member {string} [indexScript] The full build index script - * @member {array} [estimatedImpact] The estimated impact of doing recommended - * index action. - * @member {array} [reportedImpact] The values reported after index action is - * complete. + * @member {string} [requestType] The request type of the operation. + * @member {uuid} [requestId] The request type of the operation. + * @member {string} [serverName] The name of the server. + * @member {string} [databaseName] The name of the database. + * @member {string} [status] The status message returned from the server. + * @member {string} [lastModifiedTime] The operation status last modified time. + * @member {string} [queuedTime] The operation queued time. + * @member {string} [blobUri] The blob uri. + * @member {string} [errorMessage] The error message returned from the server. */ -export interface RecommendedIndex extends ProxyResource { - readonly action?: string; - readonly state?: string; - readonly created?: Date; - readonly lastModified?: Date; - readonly indexType?: string; - readonly schema?: string; - readonly table?: string; - readonly columns?: string[]; - readonly includedColumns?: string[]; - readonly indexScript?: string; - readonly estimatedImpact?: OperationImpact[]; - readonly reportedImpact?: OperationImpact[]; +export interface ImportExportResponse extends ProxyResource { + readonly requestType?: string; + readonly requestId?: string; + readonly serverName?: string; + readonly databaseName?: string; + readonly status?: string; + readonly lastModifiedTime?: string; + readonly queuedTime?: string; + readonly blobUri?: string; + readonly errorMessage?: string; } /** * @class - * Initializes a new instance of the Database class. + * Initializes a new instance of the ExportRequest class. * @constructor - * Represents a database. - * - * @member {string} [kind] Kind of database. This is metadata used for the - * Azure portal experience. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * Export database parameters. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + */ +export interface ExportRequest { + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; +} + +/** + * @class + * Initializes a new instance of the ImportRequest class. + * @constructor + * Import database parameters. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this + * @member {string} databaseName The name of the database to import. + * @member {string} edition The edition for the database being created. + * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @member {string} serviceObjectiveName The name of the service objective to + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', + * 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', + * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', + * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {string} maxSizeBytes The maximum size for the newly imported * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' */ -export interface Database extends TrackedResource { - readonly kind?: string; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; +export interface ImportRequest extends ExportRequest { + databaseName: string; + edition: string; + serviceObjectiveName: string; + maxSizeBytes: string; } /** * @class - * Initializes a new instance of the RecommendedElasticPool class. + * Initializes a new instance of the MetricValue class. * @constructor - * Represents a recommented elastic pool. + * Represents database metrics. * - * @member {string} [databaseEdition] The edition of the recommended elastic - * pool. The ElasticPoolEdition enumeration contains all the valid editions. - * Possible values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The DTU for the recommended elastic pool. - * @member {number} [databaseDtuMin] The minimum DTU for the database. - * @member {number} [databaseDtuMax] The maximum DTU for the database. - * @member {number} [storageMB] Gets storage size in megabytes. - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [maxObservedDtu] Gets maximum observed DTU. - * @member {number} [maxObservedStorageMB] Gets maximum observed storage in - * megabytes. - * @member {array} [databases] The list of databases in this pool. Expanded - * property - * @member {array} [metrics] The list of databases housed in the server. - * Expanded property + * @member {number} [count] The number of values for the metric. + * @member {number} [average] The average value of the metric. + * @member {number} [maximum] The max value of the metric. + * @member {number} [minimum] The min value of the metric. + * @member {date} [timestamp] The metric timestamp (ISO-8601 format). + * @member {number} [total] The total value of the metric. */ -export interface RecommendedElasticPool extends ProxyResource { - readonly databaseEdition?: string; - dtu?: number; - databaseDtuMin?: number; - databaseDtuMax?: number; - storageMB?: number; - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly maxObservedDtu?: number; - readonly maxObservedStorageMB?: number; - readonly databases?: Database[]; - readonly metrics?: RecommendedElasticPoolMetric[]; +export interface MetricValue { + readonly count?: number; + readonly average?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly timestamp?: Date; + readonly total?: number; } /** * @class - * Initializes a new instance of the ElasticPool class. + * Initializes a new instance of the MetricName class. * @constructor - * Represents a database elastic pool. + * A database metric name. * - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {string} [kind] Kind of elastic pool. This is metadata used for the - * Azure portal experience. + * @member {string} [value] The name of the database metric. + * @member {string} [localizedValue] The friendly name of the database metric. */ -export interface ElasticPool extends TrackedResource { - readonly creationDate?: Date; - readonly state?: string; - edition?: string; - dtu?: number; - databaseDtuMax?: number; - databaseDtuMin?: number; - storageMB?: number; - readonly kind?: string; +export interface MetricName { + readonly value?: string; + readonly localizedValue?: string; } /** * @class - * Initializes a new instance of the ElasticPoolUpdate class. + * Initializes a new instance of the Metric class. * @constructor - * Represents an elastic pool update. + * Database metrics. * - * @member {object} [tags] Resource tags. - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. + * @member {date} [startTime] The start time for the metric (ISO-8601 format). + * @member {date} [endTime] The end time for the metric (ISO-8601 format). + * @member {string} [timeGrain] The time step to be used to summarize the + * metric values. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'count', 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {array} [metricValues] The metric values for the specified time + * window and timestep. */ -export interface ElasticPoolUpdate extends Resource { - tags?: { [propertyName: string]: string }; - readonly creationDate?: Date; - readonly state?: string; - edition?: string; - dtu?: number; - databaseDtuMax?: number; - databaseDtuMin?: number; - storageMB?: number; +export interface Metric { + readonly startTime?: Date; + readonly endTime?: Date; + readonly timeGrain?: string; + readonly unit?: string; + readonly name?: MetricName; + readonly metricValues?: MetricValue[]; } /** * @class - * Initializes a new instance of the ElasticPoolActivity class. + * Initializes a new instance of the MetricAvailability class. * @constructor - * Represents the activity on an elastic pool. + * A metric availability value. * - * @member {string} [location] The geo-location where the resource lives - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {number} [requestedDatabaseDtuMax] The requested max DTU per - * database if available. - * @member {number} [requestedDatabaseDtuMin] The requested min DTU per - * database if available. - * @member {number} [requestedDtu] The requested DTU for the pool if available. - * @member {string} [requestedElasticPoolName] The requested name for the - * elastic pool if available. - * @member {number} [requestedStorageLimitInGB] The requested storage limit for - * the pool in GB if available. - * @member {string} [elasticPoolName] The name of the elastic pool. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. - * @member {number} [requestedStorageLimitInMB] The requested storage limit in - * MB. - * @member {number} [requestedDatabaseDtuGuarantee] The requested per database - * DTU guarantee. - * @member {number} [requestedDatabaseDtuCap] The requested per database DTU - * cap. - * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. + * @member {string} [retention] The length of retention for the database + * metric. + * @member {string} [timeGrain] The granularity of the database metric. */ -export interface ElasticPoolActivity extends ProxyResource { - location?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedDatabaseDtuMax?: number; - readonly requestedDatabaseDtuMin?: number; - readonly requestedDtu?: number; - readonly requestedElasticPoolName?: string; - readonly requestedStorageLimitInGB?: number; - readonly elasticPoolName?: string; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly requestedStorageLimitInMB?: number; - readonly requestedDatabaseDtuGuarantee?: number; - readonly requestedDatabaseDtuCap?: number; - readonly requestedDtuGuarantee?: number; +export interface MetricAvailability { + readonly retention?: string; + readonly timeGrain?: string; +} + +/** + * @class + * Initializes a new instance of the MetricDefinition class. + * @constructor + * A database metric definition. + * + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {string} [primaryAggregationType] The primary aggregation type + * defining how metric values are displayed. Possible values include: 'None', + * 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + * @member {string} [resourceUri] The resource uri of the database. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + * @member {array} [metricAvailabilities] The list of database metric + * availabities for the metric. + */ +export interface MetricDefinition { + readonly name?: MetricName; + readonly primaryAggregationType?: string; + readonly resourceUri?: string; + readonly unit?: string; + readonly metricAvailabilities?: MetricAvailability[]; } /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the ReplicationLink class. * @constructor - * Represents the activity on an elastic pool. + * Represents a database replication link. * - * @member {string} [location] The geo-location where the resource lives - * @member {string} [databaseName] The database name. - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {string} [requestedElasticPoolName] The name for the elastic pool - * the database is moving into if available. - * @member {string} [currentElasticPoolName] The name of the current elastic - * pool the database is in if available. - * @member {string} [currentServiceObjective] The name of the current service - * objective if available. - * @member {string} [requestedServiceObjective] The name of the requested - * service objective if available. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {boolean} [isTerminationAllowed] Legacy value indicating whether + * termination is allowed. Currently always returns true. + * @member {string} [replicationMode] Replication mode of this replication + * link. + * @member {string} [partnerServer] The name of the server hosting the partner + * database. + * @member {string} [partnerDatabase] The name of the partner database. + * @member {string} [partnerLocation] The Azure Region of the partner database. + * @member {string} [role] The role of the database in the replication link. + * Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', + * 'Source', 'Copy' + * @member {string} [partnerRole] The role of the partner database in the + * replication link. Possible values include: 'Primary', 'Secondary', + * 'NonReadableSecondary', 'Source', 'Copy' + * @member {date} [startTime] The start time for the replication link. + * @member {number} [percentComplete] The percentage of seeding complete for + * the replication link. + * @member {string} [replicationState] The replication state for the + * replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + * 'SUSPENDED' */ -export interface ElasticPoolDatabaseActivity extends ProxyResource { - location?: string; - readonly databaseName?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedElasticPoolName?: string; - readonly currentElasticPoolName?: string; - readonly currentServiceObjective?: string; - readonly requestedServiceObjective?: string; - readonly serverName?: string; +export interface ReplicationLink extends ProxyResource { + readonly location?: string; + readonly isTerminationAllowed?: boolean; + readonly replicationMode?: string; + readonly partnerServer?: string; + readonly partnerDatabase?: string; + readonly partnerLocation?: string; + readonly role?: string; + readonly partnerRole?: string; readonly startTime?: Date; - readonly state?: string; + readonly percentComplete?: number; + readonly replicationState?: string; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the ServerAzureADAdministrator class. * @constructor - * Represents a database update. - * - * @member {object} [tags] Resource tags. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * An server Active Directory Administrator. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' + * @member {string} login The server administrator login value. + * @member {uuid} sid The server administrator Sid (Secure ID). + * @member {uuid} tenantId The server Active Directory Administrator tenant id. */ -export interface DatabaseUpdate extends Resource { - tags?: { [propertyName: string]: string }; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; +export interface ServerAzureADAdministrator extends ProxyResource { + login: string; + sid: string; + tenantId: string; } /** * @class - * Initializes a new instance of the TransparentDataEncryptionActivity class. + * Initializes a new instance of the ServerCommunicationLink class. * @constructor - * Represents a database transparent data encryption Scan. + * Server communication link. * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database. Possible values - * include: 'Encrypting', 'Decrypting' - * @member {number} [percentComplete] The percent complete of the transparent - * data encryption scan for a database. + * @member {string} [state] The state. + * @member {string} partnerServer The name of the partner server. + * @member {string} [location] Communication link location. + * @member {string} [kind] Communication link kind. This property is used for + * Azure Portal metadata. + */ +export interface ServerCommunicationLink extends ProxyResource { + readonly state?: string; + partnerServer: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceObjective class. + * @constructor + * Represents a database service objective. + * + * @member {string} [serviceObjectiveName] The name for the service objective. + * @member {boolean} [isDefault] Gets whether the service level objective is + * the default service objective. + * @member {boolean} [isSystem] Gets whether the service level objective is a + * system service objective. + * @member {string} [description] The description for the service level + * objective. + * @member {boolean} [enabled] Gets whether the service level objective is + * enabled. */ -export interface TransparentDataEncryptionActivity extends ProxyResource { - readonly location?: string; - readonly status?: string; - readonly percentComplete?: number; +export interface ServiceObjective extends ProxyResource { + readonly serviceObjectiveName?: string; + readonly isDefault?: boolean; + readonly isSystem?: boolean; + readonly description?: string; + readonly enabled?: boolean; } /** @@ -1729,6 +1746,48 @@ export interface DatabaseBlobAuditingPolicy extends ProxyResource { isStorageSecondaryKeyInUse?: boolean; } +/** + * @class + * Initializes a new instance of the AutomaticTuningOptions class. + * @constructor + * Automatic tuning properties for individual advisors. + * + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual state + * are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', + * 'QueryStoreReadOnly', 'NotSupported' + */ +export interface AutomaticTuningOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; +} + +/** + * @class + * Initializes a new instance of the DatabaseAutomaticTuning class. + * @constructor + * Database-level Automatic Tuning. + * + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ +export interface DatabaseAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningOptions }; +} + /** * @class * Initializes a new instance of the EncryptionProtector class. @@ -2312,6 +2371,24 @@ export interface SyncMember extends ProxyResource { readonly syncState?: string; } +/** + * @class + * Initializes a new instance of the SubscriptionUsage class. + * @constructor + * Usage Metric of a Subscription in a Location. + * + * @member {string} [displayName] User-readable name of the metric. + * @member {number} [currentValue] Current value of the metric. + * @member {number} [limit] Boundary value of the metric. + * @member {string} [unit] Unit of the metric. + */ +export interface SubscriptionUsage extends ProxyResource { + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; +} + /** * @class * Initializes a new instance of the VirtualNetworkRule class. @@ -2331,6 +2408,167 @@ export interface VirtualNetworkRule extends ProxyResource { readonly state?: string; } +/** + * @class + * Initializes a new instance of the LongTermRetentionBackup class. + * @constructor + * A long term retention backup. + * + * @member {string} [serverName] The server name that the backup database + * belong to. + * @member {date} [serverCreateTime] The create time of the server. + * @member {string} [databaseName] The name of the database the backup belong + * to + * @member {date} [databaseDeletionTime] The delete time of the database + * @member {date} [backupTime] The time the backup was taken + * @member {date} [backupExpirationTime] The time the long term retention + * backup will expire. + */ +export interface LongTermRetentionBackup extends ProxyResource { + readonly serverName?: string; + readonly serverCreateTime?: Date; + readonly databaseName?: string; + readonly databaseDeletionTime?: Date; + readonly backupTime?: Date; + readonly backupExpirationTime?: Date; +} + +/** + * @class + * Initializes a new instance of the BackupLongTermRetentionPolicy class. + * @constructor + * A long term retention policy. + * + * @member {string} [weeklyRetention] The weekly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [monthlyRetention] The montly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [yearlyRetention] The yearly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {number} [weekOfYear] The week of year to take the yearly backup in + * an ISO 8601 format. + */ +export interface BackupLongTermRetentionPolicy extends ProxyResource { + weeklyRetention?: string; + monthlyRetention?: string; + yearlyRetention?: string; + weekOfYear?: number; +} + +/** + * @class + * Initializes a new instance of the ResourceMoveDefinition class. + * @constructor + * Contains the information necessary to perform a resource move (rename). + * + * @member {string} id The target ID for the resource + */ +export interface ResourceMoveDefinition { + id: string; +} + +/** + * @class + * Initializes a new instance of the AutomaticTuningServerOptions class. + * @constructor + * Automatic tuning properties for individual advisors. + * + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual state + * are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured' + */ +export interface AutomaticTuningServerOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; +} + +/** + * @class + * Initializes a new instance of the ServerAutomaticTuning class. + * @constructor + * Server-level Automatic Tuning. + * + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ +export interface ServerAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningServerOptions }; +} + +/** + * @class + * Initializes a new instance of the ServerDnsAlias class. + * @constructor + * A server DNS alias. + * + * @member {string} [azureDnsRecord] The fully qualified DNS record for alias + */ +export interface ServerDnsAlias extends ProxyResource { + readonly azureDnsRecord?: string; +} + +/** + * @class + * Initializes a new instance of the ServerDnsAliasAcquisition class. + * @constructor + * A server DNS alias acquisition request. + * + * @member {string} [oldServerDnsAliasId] The id of the server alias that will + * be acquired to point to this server instead. + */ +export interface ServerDnsAliasAcquisition { + oldServerDnsAliasId?: string; +} + +/** + * @class + * Initializes a new instance of the RestorePoint class. + * @constructor + * Database restore points. + * + * @member {string} [location] Resource location. + * @member {string} [restorePointType] The type of restore point. Possible + * values include: 'CONTINUOUS', 'DISCRETE' + * @member {date} [earliestRestoreDate] The earliest time to which this + * database can be restored + * @member {date} [restorePointCreationDate] The time the backup was taken + * @member {string} [restorePointLabel] The label of restore point for backup + * request by user + */ +export interface RestorePoint extends ProxyResource { + readonly location?: string; + readonly restorePointType?: string; + readonly earliestRestoreDate?: Date; + readonly restorePointCreationDate?: Date; + readonly restorePointLabel?: string; +} + +/** + * @class + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. + * @constructor + * Contains the information necessary to perform a create database restore + * point operation. + * + * @member {string} restorePointLabel The restore point label to apply + */ +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; +} + /** * @class * Initializes a new instance of the DatabaseOperation class. @@ -2352,6 +2590,10 @@ export interface VirtualNetworkRule extends ProxyResource { * @member {string} [errorDescription] The operation error description. * @member {number} [errorSeverity] The operation error severity. * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ export interface DatabaseOperation extends ProxyResource { readonly databaseName?: string; @@ -2365,19 +2607,53 @@ export interface DatabaseOperation extends ProxyResource { readonly errorDescription?: string; readonly errorSeverity?: number; readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; } - /** * @class - * Initializes a new instance of the RestorePointListResult class. + * Initializes a new instance of the ElasticPoolOperation class. * @constructor - * The response to a list database restore points request. + * A elastic pool operation. * + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ -export interface RestorePointListResult extends Array { +export interface ElasticPoolOperation extends ProxyResource { + readonly elasticPoolName?: string; + readonly operation?: string; + readonly operationFriendlyName?: string; + readonly percentComplete?: number; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; } + /** * @class * Initializes a new instance of the RecoverableDatabaseListResult class. @@ -2400,32 +2676,24 @@ export interface RestorableDroppedDatabaseListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the FirewallRuleListResult class. + * Initializes a new instance of the ServerListResult class. * @constructor - * Represents the response to a List Firewall Rules request. + * A list of servers. * + * @member {string} [nextLink] Link to retrieve next page of results. */ -export interface FirewallRuleListResult extends Array { +export interface ServerListResult extends Array { + readonly nextLink?: string; } /** * @class - * Initializes a new instance of the GeoBackupPolicyListResult class. + * Initializes a new instance of the DatabaseListResult class. * @constructor - * The response to a list geo backup policies request. + * Represents the response to a list database request. * */ -export interface GeoBackupPolicyListResult extends Array { +export interface DatabaseListResult extends Array { } /** @@ -2450,12 +2718,12 @@ export interface MetricDefinitionListResult extends Array { /** * @class - * Initializes a new instance of the DatabaseListResult class. + * Initializes a new instance of the DataMaskingRuleListResult class. * @constructor - * Represents the response to a list database request. + * The response to a list data masking rules request. * */ -export interface DatabaseListResult extends Array { +export interface DataMaskingRuleListResult extends Array { } /** @@ -2468,6 +2736,26 @@ export interface DatabaseListResult extends Array { export interface ElasticPoolListResult extends Array { } +/** + * @class + * Initializes a new instance of the FirewallRuleListResult class. + * @constructor + * Represents the response to a List Firewall Rules request. + * + */ +export interface FirewallRuleListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the GeoBackupPolicyListResult class. + * @constructor + * The response to a list geo backup policies request. + * + */ +export interface GeoBackupPolicyListResult extends Array { +} + /** * @class * Initializes a new instance of the ReplicationLinkListResult class. @@ -2508,18 +2796,6 @@ export interface ServerCommunicationLinkListResult extends Array { } -/** - * @class - * Initializes a new instance of the ServerListResult class. - * @constructor - * A list of servers. - * - * @member {string} [nextLink] Link to retrieve next page of results. - */ -export interface ServerListResult extends Array { - readonly nextLink?: string; -} - /** * @class * Initializes a new instance of the ElasticPoolActivityListResult class. @@ -2733,6 +3009,18 @@ export interface SyncMemberListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the SubscriptionUsageListResult class. + * @constructor + * A list of subscription usage metrics in a location. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface SubscriptionUsageListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the VirtualNetworkRuleListResult class. @@ -2745,6 +3033,42 @@ export interface VirtualNetworkRuleListResult extends Array readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the LongTermRetentionBackupListResult class. + * @constructor + * A list of long term retention bacukps. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface LongTermRetentionBackupListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ServerDnsAliasListResult class. + * @constructor + * A list of server DNS aliases. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ServerDnsAliasListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RestorePointListResult class. + * @constructor + * A list of long term retention bacukps. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface RestorePointListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the DatabaseOperationListResult class. @@ -2756,3 +3080,15 @@ export interface VirtualNetworkRuleListResult extends Array export interface DatabaseOperationListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the ElasticPoolOperationListResult class. + * @constructor + * The response to a list elastic pool operations request + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ElasticPoolOperationListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 8699dee3ab..936e303e18 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -19,11 +19,8 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Resource = require('./resource'); -exports.ProxyResource = require('./proxyResource'); -exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); -exports.BackupLongTermRetentionVault = require('./backupLongTermRetentionVault'); exports.TrackedResource = require('./trackedResource'); -exports.RestorePoint = require('./restorePoint'); +exports.ProxyResource = require('./proxyResource'); exports.RecoverableDatabase = require('./recoverableDatabase'); exports.RestorableDroppedDatabase = require('./restorableDroppedDatabase'); exports.MaxSizeCapability = require('./maxSizeCapability'); @@ -35,10 +32,26 @@ exports.ElasticPoolDtuCapability = require('./elasticPoolDtuCapability'); exports.ElasticPoolEditionCapability = require('./elasticPoolEditionCapability'); exports.ServerVersionCapability = require('./serverVersionCapability'); exports.LocationCapabilities = require('./locationCapabilities'); +exports.CheckNameAvailabilityRequest = require('./checkNameAvailabilityRequest'); +exports.CheckNameAvailabilityResponse = require('./checkNameAvailabilityResponse'); exports.ServerConnectionPolicy = require('./serverConnectionPolicy'); +exports.SloUsageMetric = require('./sloUsageMetric'); +exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); +exports.TransparentDataEncryption = require('./transparentDataEncryption'); +exports.OperationImpact = require('./operationImpact'); +exports.RecommendedIndex = require('./recommendedIndex'); +exports.Database = require('./database'); +exports.DatabaseUpdate = require('./databaseUpdate'); +exports.TransparentDataEncryptionActivity = require('./transparentDataEncryptionActivity'); +exports.ElasticPoolDatabaseActivity = require('./elasticPoolDatabaseActivity'); +exports.ElasticPoolActivity = require('./elasticPoolActivity'); +exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); +exports.RecommendedElasticPool = require('./recommendedElasticPool'); exports.DatabaseSecurityAlertPolicy = require('./databaseSecurityAlertPolicy'); exports.DataMaskingPolicy = require('./dataMaskingPolicy'); exports.DataMaskingRule = require('./dataMaskingRule'); +exports.ElasticPool = require('./elasticPool'); +exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); exports.FirewallRule = require('./firewallRule'); exports.GeoBackupPolicy = require('./geoBackupPolicy'); exports.ImportExtensionRequest = require('./importExtensionRequest'); @@ -54,25 +67,11 @@ exports.ReplicationLink = require('./replicationLink'); exports.ServerAzureADAdministrator = require('./serverAzureADAdministrator'); exports.ServerCommunicationLink = require('./serverCommunicationLink'); exports.ServiceObjective = require('./serviceObjective'); -exports.CheckNameAvailabilityRequest = require('./checkNameAvailabilityRequest'); -exports.CheckNameAvailabilityResponse = require('./checkNameAvailabilityResponse'); -exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); -exports.SloUsageMetric = require('./sloUsageMetric'); -exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); -exports.TransparentDataEncryption = require('./transparentDataEncryption'); -exports.OperationImpact = require('./operationImpact'); -exports.RecommendedIndex = require('./recommendedIndex'); -exports.Database = require('./database'); -exports.RecommendedElasticPool = require('./recommendedElasticPool'); -exports.ElasticPool = require('./elasticPool'); -exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); -exports.ElasticPoolActivity = require('./elasticPoolActivity'); -exports.ElasticPoolDatabaseActivity = require('./elasticPoolDatabaseActivity'); -exports.DatabaseUpdate = require('./databaseUpdate'); -exports.TransparentDataEncryptionActivity = require('./transparentDataEncryptionActivity'); exports.ServerUsage = require('./serverUsage'); exports.DatabaseUsage = require('./databaseUsage'); exports.DatabaseBlobAuditingPolicy = require('./databaseBlobAuditingPolicy'); +exports.AutomaticTuningOptions = require('./automaticTuningOptions'); +exports.DatabaseAutomaticTuning = require('./databaseAutomaticTuning'); exports.EncryptionProtector = require('./encryptionProtector'); exports.FailoverGroupReadWriteEndpoint = require('./failoverGroupReadWriteEndpoint'); exports.FailoverGroupReadOnlyEndpoint = require('./failoverGroupReadOnlyEndpoint'); @@ -98,23 +97,33 @@ exports.SyncGroupSchemaTable = require('./syncGroupSchemaTable'); exports.SyncGroupSchema = require('./syncGroupSchema'); exports.SyncGroup = require('./syncGroup'); exports.SyncMember = require('./syncMember'); +exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); +exports.LongTermRetentionBackup = require('./longTermRetentionBackup'); +exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); +exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); +exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions'); +exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); +exports.ServerDnsAlias = require('./serverDnsAlias'); +exports.ServerDnsAliasAcquisition = require('./serverDnsAliasAcquisition'); +exports.RestorePoint = require('./restorePoint'); +exports.CreateDatabaseRestorePointDefinition = require('./createDatabaseRestorePointDefinition'); exports.DatabaseOperation = require('./databaseOperation'); -exports.RestorePointListResult = require('./restorePointListResult'); +exports.ElasticPoolOperation = require('./elasticPoolOperation'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); -exports.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); -exports.FirewallRuleListResult = require('./firewallRuleListResult'); -exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); +exports.ServerListResult = require('./serverListResult'); +exports.DatabaseListResult = require('./databaseListResult'); exports.MetricListResult = require('./metricListResult'); exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); -exports.DatabaseListResult = require('./databaseListResult'); +exports.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); exports.ElasticPoolListResult = require('./elasticPoolListResult'); +exports.FirewallRuleListResult = require('./firewallRuleListResult'); +exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); exports.ReplicationLinkListResult = require('./replicationLinkListResult'); exports.ServerAdministratorListResult = require('./serverAdministratorListResult'); exports.ServerCommunicationLinkListResult = require('./serverCommunicationLinkListResult'); exports.ServiceObjectiveListResult = require('./serviceObjectiveListResult'); -exports.ServerListResult = require('./serverListResult'); exports.ElasticPoolActivityListResult = require('./elasticPoolActivityListResult'); exports.ElasticPoolDatabaseActivityListResult = require('./elasticPoolDatabaseActivityListResult'); exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); @@ -134,5 +143,10 @@ exports.SyncFullSchemaPropertiesListResult = require('./syncFullSchemaProperties exports.SyncGroupLogListResult = require('./syncGroupLogListResult'); exports.SyncGroupListResult = require('./syncGroupListResult'); exports.SyncMemberListResult = require('./syncMemberListResult'); +exports.SubscriptionUsageListResult = require('./subscriptionUsageListResult'); exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); +exports.LongTermRetentionBackupListResult = require('./longTermRetentionBackupListResult'); +exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); +exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); +exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); diff --git a/lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js b/lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js new file mode 100644 index 0000000000..d5c13d1442 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js @@ -0,0 +1,129 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A long term retention backup. + * + * @extends models['ProxyResource'] + */ +class LongTermRetentionBackup extends models['ProxyResource'] { + /** + * Create a LongTermRetentionBackup. + * @member {string} [serverName] The server name that the backup database + * belong to. + * @member {date} [serverCreateTime] The create time of the server. + * @member {string} [databaseName] The name of the database the backup belong + * to + * @member {date} [databaseDeletionTime] The delete time of the database + * @member {date} [backupTime] The time the backup was taken + * @member {date} [backupExpirationTime] The time the long term retention + * backup will expire. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LongTermRetentionBackup + * + * @returns {object} metadata of LongTermRetentionBackup + * + */ + mapper() { + return { + required: false, + serializedName: 'LongTermRetentionBackup', + type: { + name: 'Composite', + className: 'LongTermRetentionBackup', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + serverName: { + required: false, + readOnly: true, + serializedName: 'properties.serverName', + type: { + name: 'String' + } + }, + serverCreateTime: { + required: false, + readOnly: true, + serializedName: 'properties.serverCreateTime', + type: { + name: 'DateTime' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'properties.databaseName', + type: { + name: 'String' + } + }, + databaseDeletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.databaseDeletionTime', + type: { + name: 'DateTime' + } + }, + backupTime: { + required: false, + readOnly: true, + serializedName: 'properties.backupTime', + type: { + name: 'DateTime' + } + }, + backupExpirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.backupExpirationTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = LongTermRetentionBackup; diff --git a/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js b/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js new file mode 100644 index 0000000000..a03e44911a --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js @@ -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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of long term retention bacukps. + */ +class LongTermRetentionBackupListResult extends Array { + /** + * Create a LongTermRetentionBackupListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LongTermRetentionBackupListResult + * + * @returns {object} metadata of LongTermRetentionBackupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LongTermRetentionBackupListResult', + type: { + name: 'Composite', + className: 'LongTermRetentionBackupListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LongTermRetentionBackupElementType', + type: { + name: 'Composite', + className: 'LongTermRetentionBackup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LongTermRetentionBackupListResult; diff --git a/lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js b/lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js new file mode 100644 index 0000000000..db42dcff0f --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js @@ -0,0 +1,52 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the information necessary to perform a resource move (rename). + * + */ +class ResourceMoveDefinition { + /** + * Create a ResourceMoveDefinition. + * @member {string} id The target ID for the resource + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMoveDefinition + * + * @returns {object} metadata of ResourceMoveDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMoveDefinition', + type: { + name: 'Composite', + className: 'ResourceMoveDefinition', + modelProperties: { + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMoveDefinition; diff --git a/lib/services/sqlManagement2/lib/models/restorePoint.js b/lib/services/sqlManagement2/lib/models/restorePoint.js index 0df5375556..0765e34c30 100644 --- a/lib/services/sqlManagement2/lib/models/restorePoint.js +++ b/lib/services/sqlManagement2/lib/models/restorePoint.js @@ -13,20 +13,21 @@ const models = require('./index'); /** - * A database restore point. + * Database restore points. * * @extends models['ProxyResource'] */ class RestorePoint extends models['ProxyResource'] { /** * Create a RestorePoint. - * @member {string} [restorePointType] The restore point type of the database - * restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' - * @member {date} [restorePointCreationDate] Restore point creation time - * (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null - * otherwise. - * @member {date} [earliestRestoreDate] Earliest restore time (ISO8601 - * format). Populated when restorePointType = DISCRETE. Null otherwise. + * @member {string} [location] Resource location. + * @member {string} [restorePointType] The type of restore point. Possible + * values include: 'CONTINUOUS', 'DISCRETE' + * @member {date} [earliestRestoreDate] The earliest time to which this + * database can be restored + * @member {date} [restorePointCreationDate] The time the backup was taken + * @member {string} [restorePointLabel] The label of restore point for backup + * request by user */ constructor() { super(); @@ -70,13 +71,29 @@ class RestorePoint extends models['ProxyResource'] { name: 'String' } }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + }, restorePointType: { required: false, readOnly: true, serializedName: 'properties.restorePointType', type: { name: 'Enum', - allowedValues: [ 'DISCRETE', 'CONTINUOUS' ] + allowedValues: [ 'CONTINUOUS', 'DISCRETE' ] + } + }, + earliestRestoreDate: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestoreDate', + type: { + name: 'DateTime' } }, restorePointCreationDate: { @@ -87,12 +104,12 @@ class RestorePoint extends models['ProxyResource'] { name: 'DateTime' } }, - earliestRestoreDate: { + restorePointLabel: { required: false, readOnly: true, - serializedName: 'properties.earliestRestoreDate', + serializedName: 'properties.restorePointLabel', type: { - name: 'DateTime' + name: 'String' } } } diff --git a/lib/services/sqlManagement2/lib/models/restorePointListResult.js b/lib/services/sqlManagement2/lib/models/restorePointListResult.js index 013c4b5fda..e89c1079ba 100644 --- a/lib/services/sqlManagement2/lib/models/restorePointListResult.js +++ b/lib/services/sqlManagement2/lib/models/restorePointListResult.js @@ -11,11 +11,12 @@ 'use strict'; /** - * The response to a list database restore points request. + * A list of long term retention bacukps. */ class RestorePointListResult extends Array { /** * Create a RestorePointListResult. + * @member {string} [nextLink] Link to retrieve next page of results. */ constructor() { super(); @@ -36,7 +37,8 @@ class RestorePointListResult extends Array { className: 'RestorePointListResult', modelProperties: { value: { - required: true, + required: false, + readOnly: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js b/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js new file mode 100644 index 0000000000..339999b62f --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Server-level Automatic Tuning. + * + * @extends models['ProxyResource'] + */ +class ServerAutomaticTuning extends models['ProxyResource'] { + /** + * Create a ServerAutomaticTuning. + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerAutomaticTuning + * + * @returns {object} metadata of ServerAutomaticTuning + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerAutomaticTuning', + type: { + name: 'Composite', + className: 'ServerAutomaticTuning', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + desiredState: { + required: false, + serializedName: 'properties.desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Custom', 'Auto', 'Unspecified' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'properties.actualState', + type: { + name: 'Enum', + allowedValues: [ 'Custom', 'Auto', 'Unspecified' ] + } + }, + options: { + required: false, + serializedName: 'properties.options', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AutomaticTuningServerOptionsElementType', + type: { + name: 'Composite', + className: 'AutomaticTuningServerOptions' + } + } + } + } + } + } + }; + } +} + +module.exports = ServerAutomaticTuning; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAlias.js b/lib/services/sqlManagement2/lib/models/serverDnsAlias.js new file mode 100644 index 0000000000..34d55a5648 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAlias.js @@ -0,0 +1,81 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A server DNS alias. + * + * @extends models['ProxyResource'] + */ +class ServerDnsAlias extends models['ProxyResource'] { + /** + * Create a ServerDnsAlias. + * @member {string} [azureDnsRecord] The fully qualified DNS record for alias + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerDnsAlias + * + * @returns {object} metadata of ServerDnsAlias + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAlias', + type: { + name: 'Composite', + className: 'ServerDnsAlias', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + azureDnsRecord: { + required: false, + readOnly: true, + serializedName: 'properties.azureDnsRecord', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAlias; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js b/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js new file mode 100644 index 0000000000..7ea9139af4 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js @@ -0,0 +1,53 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A server DNS alias acquisition request. + * + */ +class ServerDnsAliasAcquisition { + /** + * Create a ServerDnsAliasAcquisition. + * @member {string} [oldServerDnsAliasId] The id of the server alias that + * will be acquired to point to this server instead. + */ + constructor() { + } + + /** + * Defines the metadata of ServerDnsAliasAcquisition + * + * @returns {object} metadata of ServerDnsAliasAcquisition + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAliasAcquisition', + type: { + name: 'Composite', + className: 'ServerDnsAliasAcquisition', + modelProperties: { + oldServerDnsAliasId: { + required: false, + serializedName: 'oldServerDnsAliasId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAliasAcquisition; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js b/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js new file mode 100644 index 0000000000..6d85947ac1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js @@ -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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of server DNS aliases. + */ +class ServerDnsAliasListResult extends Array { + /** + * Create a ServerDnsAliasListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerDnsAliasListResult + * + * @returns {object} metadata of ServerDnsAliasListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAliasListResult', + type: { + name: 'Composite', + className: 'ServerDnsAliasListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServerDnsAliasElementType', + type: { + name: 'Composite', + className: 'ServerDnsAlias' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAliasListResult; diff --git a/lib/services/sqlManagement2/lib/models/sloUsageMetric.js b/lib/services/sqlManagement2/lib/models/sloUsageMetric.js index 5a33118590..5f0b849435 100644 --- a/lib/services/sqlManagement2/lib/models/sloUsageMetric.js +++ b/lib/services/sqlManagement2/lib/models/sloUsageMetric.js @@ -18,9 +18,15 @@ class SloUsageMetric { /** * Create a SloUsageMetric. * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' + * usage metric. Possible values include: 'System', 'System0', 'System1', + * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', + * 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', + * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for * SLO usage metric. * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO diff --git a/lib/services/sqlManagement2/lib/models/subscriptionUsage.js b/lib/services/sqlManagement2/lib/models/subscriptionUsage.js new file mode 100644 index 0000000000..d58c9739c1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/subscriptionUsage.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Usage Metric of a Subscription in a Location. + * + * @extends models['ProxyResource'] + */ +class SubscriptionUsage extends models['ProxyResource'] { + /** + * Create a SubscriptionUsage. + * @member {string} [displayName] User-readable name of the metric. + * @member {number} [currentValue] Current value of the metric. + * @member {number} [limit] Boundary value of the metric. + * @member {string} [unit] Unit of the metric. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubscriptionUsage + * + * @returns {object} metadata of SubscriptionUsage + * + */ + mapper() { + return { + required: false, + serializedName: 'SubscriptionUsage', + type: { + name: 'Composite', + className: 'SubscriptionUsage', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + currentValue: { + required: false, + readOnly: true, + serializedName: 'properties.currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + readOnly: true, + serializedName: 'properties.limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'properties.unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubscriptionUsage; diff --git a/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js b/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js new file mode 100644 index 0000000000..9405a6b359 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js @@ -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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of subscription usage metrics in a location. + */ +class SubscriptionUsageListResult extends Array { + /** + * Create a SubscriptionUsageListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubscriptionUsageListResult + * + * @returns {object} metadata of SubscriptionUsageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SubscriptionUsageListResult', + type: { + name: 'Composite', + className: 'SubscriptionUsageListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubscriptionUsageElementType', + type: { + name: 'Composite', + className: 'SubscriptionUsage' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubscriptionUsageListResult; diff --git a/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js b/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js index 7f1daa1b00..c61520f84b 100644 --- a/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js @@ -15,7 +15,7 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -54,13 +54,10 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let backupLongTermRetentionPolicyName = 'Default'; + let policyName = 'default'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -70,6 +67,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -79,12 +79,12 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{backupLongTermRetentionPolicyName}', encodeURIComponent(backupLongTermRetentionPolicyName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -170,7 +170,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -178,16 +178,21 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -261,7 +266,159 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } /** - * Creates or updates a database backup long term retention policy + * Gets a database's long term retention policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabase(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupLongTermRetentionPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -269,16 +426,21 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -309,13 +471,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let backupLongTermRetentionPolicyName = 'Default'; + let policyName = 'default'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -328,6 +487,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -337,12 +499,12 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{backupLongTermRetentionPolicyName}', encodeURIComponent(backupLongTermRetentionPolicyName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -390,7 +552,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -435,23 +597,6 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupLongTermRetentionPolicy']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -467,11 +612,12 @@ class BackupLongTermRetentionPolicies { this.client = client; this._get = _get; this._createOrUpdate = _createOrUpdate; + this._listByDatabase = _listByDatabase; this._beginCreateOrUpdate = _beginCreateOrUpdate; } /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -507,7 +653,7 @@ class BackupLongTermRetentionPolicies { } /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -566,7 +712,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -574,16 +720,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -611,7 +762,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -619,16 +770,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -679,7 +835,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -687,16 +843,116 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {object} [options] Optional Parameters. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database's long term retention policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Sets a database's long term retention policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -724,7 +980,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -732,16 +988,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js b/lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js new file mode 100644 index 0000000000..5bf2f22d25 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js @@ -0,0 +1,563 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a database's automatic tuning. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update automatic tuning properties for target database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a DatabaseAutomaticTuningOperations. */ +class DatabaseAutomaticTuningOperations { + /** + * Create a DatabaseAutomaticTuningOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._update = _update; + } + + /** + * Gets a database's automatic tuning. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database's automatic tuning. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Update automatic tuning properties for target database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update automatic tuning properties for target database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + +} + +module.exports = DatabaseAutomaticTuningOperations; diff --git a/lib/services/sqlManagement2/lib/operations/databaseOperations.js b/lib/services/sqlManagement2/lib/operations/databaseOperations.js index 8eeb0eaf28..28a46543cf 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseOperations.js +++ b/lib/services/sqlManagement2/lib/operations/databaseOperations.js @@ -54,7 +54,7 @@ function _cancel(resourceGroupName, serverName, databaseName, operationId, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2017-10-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -193,7 +193,7 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2017-10-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index 972ce3df41..7e2d2ea7df 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -16,7 +16,7 @@ const WebResource = msRest.WebResource; /** - * Imports a bacpac into a new database. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -24,39 +24,7 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -69,14 +37,13 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _importMethod(resourceGroupName, serverName, parameters, options, callback) { +function _pause(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -89,7 +56,7 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb } // Send request - this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -108,20 +75,6 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb if (responseBody === '') responseBody = null; // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -130,8 +83,7 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -139,31 +91,7 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -176,14 +104,13 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _resume(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -196,7 +123,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par } // Send request - this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -215,20 +142,6 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par if (responseBody === '') responseBody = null; // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -237,7 +150,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par /** - * Exports a database to a bacpac. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -245,26 +158,146 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * - * @param {object} parameters The required parameters for exporting a database. + * @param {object} parameters The required parameters for creating or updating + * a database. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.storageUri The storage uri to use. + * Default: regular database creation. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -278,13 +311,13 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -297,7 +330,7 @@ function _exportMethod(resourceGroupName, serverName, databaseName, parameters, } // Send request - this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -321,7 +354,7 @@ function _exportMethod(resourceGroupName, serverName, databaseName, parameters, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -336,8 +369,9 @@ function _exportMethod(resourceGroupName, serverName, databaseName, parameters, }); } + /** - * Returns database metrics. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -345,30 +379,242 @@ function _exportMethod(resourceGroupName, serverName, databaseName, parameters, * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be updated. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The required parameters for updating a database. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.tags] Resource tags. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {function} callback - The callback. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @returns {function} callback(err, result, request, response) + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -393,9 +639,6 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -405,21 +648,20 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -444,7 +686,7 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -472,30 +714,13 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Returns database metric definitions. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -503,10 +728,14 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -517,14 +746,13 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { +function _get(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -534,6 +762,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; let apiVersion = '2014-04-01'; // Validate try { @@ -549,6 +778,9 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -558,13 +790,16 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -631,7 +866,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -646,9 +881,8 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt }); } - /** - * Pauses a data warehouse. + * Returns a list of databases in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -656,66 +890,165 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. * - * @param {function} callback - The callback. + * @param {string} [options.filter] An OData filter expression that describes a + * subset of databases to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. * * @returns {function} callback(err, result, request, response) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _pause(resourceGroupName, serverName, databaseName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2014-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } - // Send request - this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } - /** - * Resumes a data warehouse. + * Gets a database inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -723,7 +1056,10 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -736,436 +1072,119 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resume(resourceGroupName, serverName, databaseName, options, callback) { +function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2014-04-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } - // Send request - this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } -/** - * Creates a new database or updates an existing database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates an existing database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } - - // Send request - this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1180,14 +1199,14 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * Deletes a database. + * Returns a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1195,7 +1214,8 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * * @param {object} [options] Optional Parameters. * @@ -1208,13 +1228,14 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1236,8 +1257,8 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1248,11 +1269,11 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1261,7 +1282,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1286,7 +1307,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1314,13 +1335,30 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets a database. + * Gets a database inside of a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1328,14 +1366,13 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * * @param {string} serverName The name of the server. * + * @param {string} recommendedElasticPoolName The name of the elastic pool to + * be retrieved. + * * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1352,7 +1389,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, options, callback) { +function _getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1362,7 +1399,6 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; let apiVersion = '2014-04-01'; // Validate try { @@ -1375,12 +1411,12 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { + throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); + } if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1390,16 +1426,14 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1482,7 +1516,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { } /** - * Returns a list of databases in a server. + * Returns a list of databases inside a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1490,14 +1524,10 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1515,7 +1545,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByServer(resourceGroupName, serverName, options, callback) { +function _listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1525,8 +1555,6 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; let apiVersion = '2014-04-01'; // Validate try { @@ -1539,11 +1567,8 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); + if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { + throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1554,18 +1579,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1647,8 +1667,132 @@ function _listByServer(resourceGroupName, serverName, options, callback) { }); } + +/** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _importMethod(resourceGroupName, serverName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + /** - * Gets a database inside of an elastic pool. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1656,10 +1800,31 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to import into * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -1673,124 +1838,50 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, callback) { +function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1799,14 +1890,15 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Returns a list of databases in an elastic pool. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1814,8 +1906,26 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -1829,120 +1939,50 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); +function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1951,14 +1991,14 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * Gets a database inside of a recommented elastic pool. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1966,10 +2006,10 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @param {string} databaseName The name of the database. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -1983,13 +2023,13 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, callback) { +function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2011,12 +2051,12 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); - } if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2026,14 +2066,14 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2100,7 +2140,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['MetricListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2116,7 +2156,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended } /** - * Returns a list of databases inside a recommented elastic pool. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2124,8 +2164,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2139,13 +2178,14 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2167,8 +2207,8 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -2179,11 +2219,11 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2252,7 +2292,7 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2268,7 +2308,7 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende } /** - * Imports a bacpac into a new database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2276,39 +2316,12 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} databaseName The name of the database to rename. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -2321,14 +2334,13 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { +function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2338,21 +2350,24 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2362,10 +2377,11 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2397,7 +2413,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportRequest']().mapper(); + let requestModelMapper = new client.models['ResourceMoveDefinition']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -2413,7 +2429,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2441,31 +2457,13 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2473,31 +2471,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -2510,14 +2484,13 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2528,11 +2501,6 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName throw new Error('callback cannot be null.'); } let apiVersion = '2014-04-01'; - let extensionName = 'import'; - if (parameters === null || parameters === undefined) - { - parameters = {}; - } // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2547,9 +2515,6 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2559,12 +2524,11 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2573,7 +2537,7 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2591,28 +2555,14 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2637,33 +2587,16 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** - * Exports a database to a bacpac. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2671,26 +2604,7 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -2703,14 +2617,13 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2735,9 +2648,6 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2747,7 +2657,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -2778,21 +2688,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExportRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -2827,30 +2723,13 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Pauses a data warehouse. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2858,7 +2737,146 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * a database. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -2871,13 +2889,14 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2902,6 +2921,9 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2911,7 +2933,7 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -2924,7 +2946,7 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2942,14 +2964,28 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Database']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2967,23 +3003,57 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); } - return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** - * Resumes a data warehouse. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2991,7 +3061,142 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be updated. + * + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -3004,13 +3209,14 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { +function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3035,6 +3241,9 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3044,7 +3253,7 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -3057,7 +3266,7 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3075,14 +3284,28 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3110,13 +3333,30 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Creates a new database or updates an existing database. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3124,130 +3364,47 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} parameters.databaseName The name of the database to import. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -3261,13 +3418,13 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3289,9 +3446,6 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } @@ -3304,11 +3458,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3317,7 +3470,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3340,7 +3493,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['Database']().mapper(); + let requestModelMapper = new client.models['ImportRequest']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3356,7 +3509,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3391,7 +3544,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3401,30 +3554,14 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); } /** - * Updates an existing database. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3432,126 +3569,224 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database to import into * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.name] The name of the extension. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.type] The type of the extension. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * Default: regular database creation. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} parameters.storageUri The storage uri to use. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} [options] Optional Parameters. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @param {function} callback - The callback. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2014-04-01'; + let extensionName = 'import'; + if (parameters === null || parameters === undefined) + { + parameters = {}; + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Exports a database to a bacpac. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {string} 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 {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} databaseName The name of the database to be exported. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -3565,13 +3800,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3608,7 +3843,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -3621,7 +3856,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3644,7 +3879,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); + let requestModelMapper = new client.models['ExportRequest']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3695,7 +3930,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3718,11 +3953,6 @@ class Databases { */ constructor(client) { this.client = client; - this._importMethod = _importMethod; - this._createImportOperation = _createImportOperation; - this._exportMethod = _exportMethod; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; this._pause = _pause; this._resume = _resume; this._createOrUpdate = _createOrUpdate; @@ -3734,17 +3964,23 @@ class Databases { this._listByElasticPool = _listByElasticPool; this._getByRecommendedElasticPool = _getByRecommendedElasticPool; this._listByRecommendedElasticPool = _listByRecommendedElasticPool; - this._beginImportMethod = _beginImportMethod; - this._beginCreateImportOperation = _beginCreateImportOperation; - this._beginExportMethod = _beginExportMethod; + this._importMethod = _importMethod; + this._createImportOperation = _createImportOperation; + this._exportMethod = _exportMethod; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._rename = _rename; this._beginPause = _beginPause; this._beginResume = _beginResume; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginUpdate = _beginUpdate; + this._beginImportMethod = _beginImportMethod; + this._beginCreateImportOperation = _beginCreateImportOperation; + this._beginExportMethod = _beginExportMethod; } /** - * Imports a bacpac into a new database. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3752,39 +3988,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -3793,15 +3997,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3812,7 +4016,7 @@ class Databases { } /** - * Imports a bacpac into a new database. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3820,39 +4024,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -3866,7 +4038,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3874,14 +4046,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3890,20 +4061,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3911,32 +4081,8 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * + * @param {string} databaseName The name of the data warehouse to resume. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3944,15 +4090,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3963,8 +4109,7 @@ class Databases { } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3972,31 +4117,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -4010,7 +4131,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4018,14 +4139,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4034,19 +4154,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Exports a database to a bacpac. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4054,26 +4174,146 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * - * @param {object} parameters The required parameters for exporting a database. + * @param {object} parameters The required parameters for creating or updating + * a database. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.storageUri The storage uri to use. + * Default: regular database creation. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -4082,15 +4322,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4101,34 +4341,154 @@ class Databases { } /** - * Exports a database to a bacpac. + * Creates a new database or updates an existing database. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be operated on + * (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * a database. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." * - * @param {string} databaseName The name of the database to be exported. + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * - * @param {object} parameters The required parameters for exporting a database. + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -4142,7 +4502,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4151,13 +4511,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4166,19 +4526,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns database metrics. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4186,10 +4546,142 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be updated. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -4198,15 +4690,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4217,7 +4709,7 @@ class Databases { } /** - * Returns database metrics. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4225,104 +4717,142 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} databaseName The name of the database to be updated. * - * @param {function} [optionalCallback] - The optional callback. + * @param {object} parameters The required parameters for updating a database. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {object} [parameters.tags] Resource tags. * - * {Promise} A promise is returned + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @resolve {MetricListResult} - The deserialized result object. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @reject {Error} - The error object. + * Default: regular database creation. * - * {function} optionalCallback(err, result, request, response) + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * {Error} err - The Error object if an error occurred, null otherwise. + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {object} [request] - The HTTP Request object if an error did not occur. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); - } - } - - /** - * Returns database metric definitions. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} 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. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {string} serverName The name of the server. + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. * - * @param {object} [options] Optional Parameters. + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * - * @reject {Error} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns database metric definitions. + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." * - * @param {string} 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 {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * - * @param {string} serverName The name of the server. + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -4336,7 +4866,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4345,14 +4875,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4361,19 +4890,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Pauses a data warehouse. + * Deletes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4381,7 +4910,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be deleted. * * @param {object} [options] Optional Parameters. * @@ -4394,11 +4923,11 @@ class Databases { * * @reject {Error} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4409,7 +4938,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Deletes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4417,7 +4946,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be deleted. * * @param {object} [options] Optional Parameters. * @@ -4445,7 +4974,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4454,19 +4983,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Resumes a data warehouse. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4474,24 +5003,28 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4502,7 +5035,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4510,204 +5043,91 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Creates a new database or updates an existing database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {function} [optionalCallback] - The optional callback. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * {Promise} A promise is returned * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @resolve {Database} - The deserialized result object. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @reject {Error} - The error object. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {function} optionalCallback(err, result, request, response) * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Returns a list of databases in a server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} 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 {string} parameters.location Resource location. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * + * @param {string} [options.filter] An OData filter expression that describes a + * subset of databases to return. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4718,7 +5138,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Returns a list of databases in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4726,130 +5146,112 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [options.filter] An OData filter expression that describes a + * subset of databases to return. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Default: regular database creation. + * @param {function} [optionalCallback] - The optional callback. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * {Promise} A promise is returned * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @resolve {DatabaseListResult} - The deserialized result object. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @reject {Error} - The error object. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * {function} optionalCallback(err, result, request, response) * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {Error} err - The Error object if an error occurred, null otherwise. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Gets a database inside of an elastic pool. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {string} 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 {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} databaseName The name of the database to be retrieved. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database inside of an elastic pool. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} 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 {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -4878,7 +5280,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4887,19 +5289,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback); } } /** - * Updates an existing database. + * Returns a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4907,126 +5309,8 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * * @param {object} [options] Optional Parameters. * @@ -5035,15 +5319,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5054,7 +5338,7 @@ class Databases { } /** - * Updates an existing database. + * Returns a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5062,126 +5346,108 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * Default: regular database creation. + * {Promise} A promise is returned * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @resolve {DatabaseListResult} - The deserialized result object. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @reject {Error} - The error object. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * {function} optionalCallback(err, result, request, response) * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {Error} err - The Error object if an error occurred, null otherwise. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {object} [request] - The HTTP Request object if an error did not occur. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * Gets a database inside of a recommented elastic pool. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @param {string} 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 {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {string} serverName The name of the server. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {string} recommendedElasticPoolName The name of the elastic pool to + * be retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @returns {Promise} A promise is returned * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @reject {Error} - The error object. + */ + getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database inside of a recommented elastic pool. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} 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 {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} serverName The name of the server. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} recommendedElasticPoolName The name of the elastic pool to + * be retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5210,7 +5476,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5219,19 +5485,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback); } } /** - * Deletes a database. + * Returns a list of databases inside a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5239,7 +5505,8 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5248,15 +5515,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5267,7 +5534,7 @@ class Databases { } /** - * Deletes a database. + * Returns a list of databases inside a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5275,7 +5542,8 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5289,7 +5557,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5297,13 +5565,14 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { + listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5312,19 +5581,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback); } } /** - * Gets a database. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5332,28 +5601,64 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.databaseName The name of the database to import. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5364,7 +5669,7 @@ class Databases { } /** - * Gets a database. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5372,13 +5677,49 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.databaseName The name of the database to import. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5390,7 +5731,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5399,13 +5740,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, databaseName, options, optionalCallback) { + importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5414,19 +5755,20 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); } } /** - * Returns a list of databases in a server. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5434,29 +5776,48 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database to import into * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5467,22 +5828,42 @@ class Databases { } /** - * Returns a list of databases in a server. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} 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 {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} serverName The name of the server. + * @param {string} parameters.storageUri The storage uri to use. * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5494,7 +5875,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5503,13 +5884,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { + createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5518,19 +5899,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Gets a database inside of an elastic pool. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5538,10 +5919,26 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be exported. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -5550,15 +5947,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, databaseName, options) { + exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5569,7 +5966,7 @@ class Databases { } /** - * Gets a database inside of an elastic pool. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5577,10 +5974,26 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be exported. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -5594,7 +6007,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5603,13 +6016,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback) { + exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5618,19 +6031,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback); + return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns a list of databases in an elastic pool. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5638,8 +6051,10 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -5648,15 +6063,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5667,7 +6082,7 @@ class Databases { } /** - * Returns a list of databases in an elastic pool. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5675,8 +6090,10 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -5690,7 +6107,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {MetricListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5699,13 +6116,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5714,19 +6131,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); } } /** - * Gets a database inside of a recommented elastic pool. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5734,10 +6151,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -5746,15 +6160,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options) { + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5765,7 +6179,7 @@ class Databases { } /** - * Gets a database inside of a recommented elastic pool. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5773,10 +6187,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -5790,7 +6201,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5799,13 +6210,14 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback) { + listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5814,19 +6226,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback); + return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5834,8 +6246,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5844,15 +6260,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, options) { + renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5863,7 +6279,7 @@ class Databases { } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5871,8 +6287,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5886,7 +6306,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5894,14 +6314,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback) { + rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5910,19 +6329,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback); + return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Imports a bacpac into a new database. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5930,39 +6349,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -5971,66 +6358,34 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Imports a bacpac into a new database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Pauses a data warehouse. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} 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 {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -6044,7 +6399,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6052,14 +6407,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6068,20 +6422,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6089,31 +6442,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -6122,15 +6451,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6141,8 +6470,7 @@ class Databases { } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6150,31 +6478,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -6188,7 +6492,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6196,14 +6500,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6212,19 +6515,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Exports a database to a bacpac. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6232,139 +6535,146 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Exports a database to a bacpac. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * - * @param {string} 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 {object} parameters The required parameters for creating or updating + * a database. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {object} parameters The required parameters for exporting a database. + * Default: regular database creation. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @param {string} parameters.storageUri The storage uri to use. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {object} [options] Optional Parameters. + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. * - * @param {function} [optionalCallback] - The optional callback. + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. * - * {Promise} A promise is returned + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * - * @reject {Error} - The error object. + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." * - * {function} optionalCallback(err, result, request, response) + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); - } - } - - /** - * Pauses a data warehouse. + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' * - * @param {string} 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 {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @param {string} serverName The name of the server. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6373,15 +6683,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6392,7 +6702,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6400,100 +6710,146 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The required parameters for creating or updating + * a database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * Default: regular database creation. * - * {Promise} A promise is returned + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @resolve {null} - The deserialized result object. + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @reject {Error} - The error object. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {function} optionalCallback(err, result, request, response) + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * {Error} err - The Error object if an error occurred, null otherwise. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * {null} [result] - The deserialized result object if an error did not occur. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * {object} [request] - The HTTP Request object if an error did not occur. + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Resumes a data warehouse. + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. * - * @param {string} 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 {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. * - * @param {string} serverName The name of the server. + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." * - * @returns {Promise} A promise is returned + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * @reject {Error} - The error object. - */ - beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Resumes a data warehouse. + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. * - * @param {string} 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 {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' * - * @param {string} serverName The name of the server. + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6507,7 +6863,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6515,13 +6871,14 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6530,19 +6887,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6550,11 +6907,11 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database to be updated. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.collation] The collation of the database. If * createMode is not Default, this value is ignored. @@ -6625,9 +6982,10 @@ class Databases { * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see * possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * * @param {string} [parameters.maxSizeBytes] The max size of the database * expressed in bytes. If createMode is not Default, this value is ignored. To @@ -6644,7 +7002,9 @@ class Databases { * value of requestedServiceObjectiveName. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * * @param {string} [parameters.requestedServiceObjectiveName] The name of the * configured service level objective of the database. This is the service @@ -6652,9 +7012,18 @@ class Databases { * Once successfully updated, it will match the value of serviceLevelObjective * property. To see possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * * @param {string} [parameters.elasticPoolName] The name of the elastic pool * the database is in. If elasticPoolName and requestedServiceObjectiveName are @@ -6671,9 +7040,9 @@ class Databases { * this value is ignored. Not supported for DataWarehouse edition. Possible * values include: 'AdventureWorksLT' * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -6686,11 +7055,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6701,7 +7070,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6709,11 +7078,11 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database to be updated. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. * * @param {string} [parameters.collation] The collation of the database. If * createMode is not Default, this value is ignored. @@ -6784,9 +7153,10 @@ class Databases { * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see * possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * * @param {string} [parameters.maxSizeBytes] The max size of the database * expressed in bytes. If createMode is not Default, this value is ignored. To @@ -6803,7 +7173,9 @@ class Databases { * value of requestedServiceObjectiveName. To see possible values, query the * capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . * * @param {string} [parameters.requestedServiceObjectiveName] The name of the * configured service level objective of the database. This is the service @@ -6811,9 +7183,18 @@ class Databases { * Once successfully updated, it will match the value of serviceLevelObjective * property. To see possible values, query the capabilities API * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * * @param {string} [parameters.elasticPoolName] The name of the elastic pool * the database is in. If elasticPoolName and requestedServiceObjectiveName are @@ -6830,9 +7211,9 @@ class Databases { * this value is ignored. Not supported for DataWarehouse edition. Possible * values include: 'AdventureWorksLT' * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -6861,7 +7242,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6870,19 +7251,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Updates an existing database. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6890,126 +7271,206 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} parameters The required parameters for updating a database. + * @param {string} parameters.databaseName The name of the database to import. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. * - * Default: regular database creation. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} parameters.storageUri The storage uri to use. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {object} [options] Optional Parameters. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @returns {Promise} A promise is returned * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @reject {Error} - The error object. + */ + beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Imports a bacpac into a new database. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} 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 {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} serverName The name of the server. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} parameters.databaseName The name of the database to import. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -7018,15 +7479,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7037,7 +7498,8 @@ class Databases { } /** - * Updates an existing database. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7045,126 +7507,163 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database to import into * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.name] The name of the extension. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.type] The type of the extension. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * Default: regular database creation. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} parameters.storageUri The storage uri to use. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} [options] Optional Parameters. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * {Promise} A promise is returned * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @resolve {ImportExportResponse} - The deserialized result object. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @reject {Error} - The error object. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * {function} optionalCallback(err, result, request, response) * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Exports a database to a bacpac. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} 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 {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -7178,7 +7677,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7187,13 +7686,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7202,14 +7701,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js b/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js new file mode 100644 index 0000000000..46a0be2f1c --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js @@ -0,0 +1,728 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId.toString())); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolOperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPoolNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolOperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ElasticPoolOperations. */ +class ElasticPoolOperations { + /** + * Create a ElasticPoolOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._cancel = _cancel; + this._listByElasticPool = _listByElasticPool; + this._listByElasticPoolNext = _listByElasticPoolNext; + } + + /** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, optionalCallback); + } + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByElasticPoolNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPoolNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByElasticPoolNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ElasticPoolOperations; diff --git a/lib/services/sqlManagement2/lib/operations/elasticPools.js b/lib/services/sqlManagement2/lib/operations/elasticPools.js index 614b262a5e..b0c55afc5e 100644 --- a/lib/services/sqlManagement2/lib/operations/elasticPools.js +++ b/lib/services/sqlManagement2/lib/operations/elasticPools.js @@ -14,8 +14,9 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; + /** - * Returns elastic pool metrics. + * Creates a new elastic pool or updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -23,10 +24,34 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The required parameters for creating or updating + * an elastic pool. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -40,13 +65,199 @@ const WebResource = msRest.WebResource; * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an existing elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be updated. + * + * @param {object} parameters The required parameters for updating an elastic + * pool. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Deletes the elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71,9 +282,6 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,21 +291,20 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -122,7 +329,7 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -150,30 +357,13 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Returns elastic pool metric definitions. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -181,7 +371,8 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * * @param {object} [options] Optional Parameters. * @@ -195,14 +386,13 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -236,7 +426,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -309,7 +499,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -324,9 +514,8 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, }); } - /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns a list of elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -334,31 +523,6 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -371,195 +535,13 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Deletes the elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -581,9 +563,6 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -593,11 +572,10 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -606,7 +584,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -631,7 +609,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -659,13 +637,30 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets an elastic pool. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -673,8 +668,10 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -688,13 +685,13 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -719,6 +716,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -728,13 +728,14 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -801,7 +802,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); + let resultMapper = new client.models['MetricListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -817,7 +818,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) } /** - * Returns a list of elastic pools in a server. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -825,6 +826,8 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -837,13 +840,14 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolListResult} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByServer(resourceGroupName, serverName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -865,6 +869,9 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -874,10 +881,11 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -946,7 +954,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -991,6 +999,10 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} parameters.location Resource location. @@ -1200,6 +1212,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1329,246 +1345,51 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + `- "${responseBody}" for the default response.`; return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a ElasticPools. */ -class ElasticPools { - /** - * Create a ElasticPools. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - } - - /** - * Returns elastic pool metrics. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns elastic pool metrics. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MetricListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); - } - } - - /** - * Returns elastic pool metric definitions. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns elastic pool metric definitions. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MetricDefinitionListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; + } + return callback(error); } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ElasticPools. */ +class ElasticPools { + /** + * Create a ElasticPools. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._listByServer = _listByServer; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; } /** @@ -1601,6 +1422,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} parameters.location Resource location. @@ -1660,6 +1485,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} parameters.location Resource location. @@ -1742,6 +1571,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1798,6 +1631,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2124,6 +1961,201 @@ class ElasticPools { } } + /** + * Returns elastic pool metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + } + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + /** * Creates a new elastic pool or updates an existing elastic pool. * @@ -2154,6 +2186,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} parameters.location Resource location. @@ -2213,6 +2249,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [parameters.tags] Resource tags. * * @param {string} parameters.location Resource location. @@ -2295,6 +2335,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2351,6 +2395,10 @@ class ElasticPools { * @param {number} [parameters.storageMB] Gets storage limit for the database * elastic pool in MB. * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/sqlManagement2/lib/operations/failoverGroups.js b/lib/services/sqlManagement2/lib/operations/failoverGroups.js index 80156eedf9..5b8e881a26 100644 --- a/lib/services/sqlManagement2/lib/operations/failoverGroups.js +++ b/lib/services/sqlManagement2/lib/operations/failoverGroups.js @@ -923,7 +923,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, failoverGroupName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js b/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js index b79462b6d7..0dc60c6b5b 100644 --- a/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js @@ -140,7 +140,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -169,7 +169,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -186,7 +186,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index 5554b98d97..c6a881e1ec 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -14,15 +14,16 @@ import * as models from '../models'; /** * @class - * BackupLongTermRetentionPolicies + * RecoverableDatabases * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface BackupLongTermRetentionPolicies { +export interface RecoverableDatabases { /** - * Returns a database backup long term retention policy + * Gets a recoverable database, which is a resource representing a database's + * geo backup * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -30,7 +31,7 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database * * @param {object} [options] Optional Parameters. * @@ -39,14 +40,15 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a database backup long term retention policy + * Gets a recoverable database, which is a resource representing a database's + * geo backup * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -54,7 +56,7 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database * * @param {object} [options] Optional Parameters. * @@ -68,7 +70,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RecoverableDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -76,21 +78,20 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {RecoverableDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link RecoverableDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database backup long term retention policy + * Gets a list of recoverable databases * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -98,17 +99,6 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -116,14 +106,14 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database backup long term retention policy + * Gets a list of recoverable databases * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -131,17 +121,6 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -154,7 +133,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RecoverableDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -162,21 +141,30 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more + * {RecoverableDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecoverableDatabaseListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RestorableDroppedDatabases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface RestorableDroppedDatabases { /** - * Creates or updates a database backup long term retention policy + * Gets a deleted database that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -184,16 +172,8 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} restorableDroppededDatabaseId The id of the deleted database + * in the form of databaseName,deletionTimeInFileTimeFormat * * @param {object} [options] Optional Parameters. * @@ -202,14 +182,14 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database backup long term retention policy + * Gets a deleted database that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -217,16 +197,8 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} restorableDroppededDatabaseId The id of the deleted database + * in the form of databaseName,deletionTimeInFileTimeFormat * * @param {object} [options] Optional Parameters. * @@ -240,7 +212,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RestorableDroppedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -248,30 +220,21 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more + * {RestorableDroppedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link RestorableDroppedDatabase} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BackupLongTermRetentionVaults - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface BackupLongTermRetentionVaults { + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server backup long term retention vault + * Gets a list of deleted databases that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -286,14 +249,14 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server backup long term retention vault + * Gets a list of deleted databases that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -313,7 +276,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {RestorableDroppedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -321,33 +284,32 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more - * information. + * {RestorableDroppedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RestorableDroppedDatabaseListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Capabilities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Capabilities { /** - * Updates a server backup long term retention vault - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * Gets the capabilities available for the specified location. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} locationId The location id whose capabilities are retrieved. * * @param {object} [options] Optional Parameters. * @@ -356,26 +318,16 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server backup long term retention vault - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * Gets the capabilities available for the specified location. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} locationId The location id whose capabilities are retrieved. * * @param {object} [options] Optional Parameters. * @@ -389,7 +341,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {LocationCapabilities} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -397,33 +349,34 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more - * information. + * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. + * See {@link LocationCapabilities} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationId: string, callback: ServiceCallback): void; + listByLocation(locationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Servers + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Servers { /** - * Updates a server backup long term retention vault - * - * @param {string} 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 {string} serverName The name of the server. + * Determines whether a resource can be created with the specified name. * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * @param {object} parameters The parameters to request for name availability. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} parameters.name The name whose availability is to be + * checked. * * @param {object} [options] Optional Parameters. * @@ -432,26 +385,19 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server backup long term retention vault - * - * @param {string} 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 {string} serverName The name of the server. + * Determines whether a resource can be created with the specified name. * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * @param {object} parameters The parameters to request for name availability. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} parameters.name The name whose availability is to be + * checked. * * @param {object} [options] Optional Parameters. * @@ -465,7 +411,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {CheckNameAvailabilityResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -473,39 +419,21 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more + * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityResponse} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RestorePoints - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorePoints { + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, callback: ServiceCallback): void; + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database restore points. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. + * Gets a list of all servers in the subscription. * * @param {object} [options] Optional Parameters. * @@ -514,23 +442,14 @@ export interface RestorePoints { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database restore points. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. + * Gets a list of all servers in the subscription. * * @param {object} [options] Optional Parameters. * @@ -544,7 +463,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePointListResult} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -552,40 +471,25 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePointListResult} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RecoverableDatabases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RecoverableDatabases { + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a recoverable database, which is a resource representing a database's - * geo backup + * Gets a list of servers in a resource groups. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -593,24 +497,19 @@ export interface RecoverableDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recoverable database, which is a resource representing a database's - * geo backup + * Gets a list of servers in a resource groups. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -623,7 +522,7 @@ export interface RecoverableDatabases { * * {Promise} A promise is returned. * - * @resolve {RecoverableDatabase} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -631,20 +530,20 @@ export interface RecoverableDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecoverableDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link RecoverableDatabase} for more information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of recoverable databases + * Gets a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -659,14 +558,14 @@ export interface RecoverableDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of recoverable databases + * Gets a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -686,7 +585,7 @@ export interface RecoverableDatabases { * * {Promise} A promise is returned. * - * @resolve {RecoverableDatabaseListResult} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -694,30 +593,20 @@ export interface RecoverableDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecoverableDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecoverableDatabaseListResult} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RestorableDroppedDatabases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorableDroppedDatabases { + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a deleted database that can be restored + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -725,8 +614,27 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * - * @param {string} restorableDroppededDatabaseId The id of the deleted database - * in the form of databaseName,deletionTimeInFileTimeFormat + * @param {object} parameters The requested server resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -735,14 +643,14 @@ export interface RestorableDroppedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a deleted database that can be restored + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -750,8 +658,27 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * - * @param {string} restorableDroppededDatabaseId The id of the deleted database - * in the form of databaseName,deletionTimeInFileTimeFormat + * @param {object} parameters The requested server resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -765,7 +692,7 @@ export interface RestorableDroppedDatabases { * * {Promise} A promise is returned. * - * @resolve {RestorableDroppedDatabase} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -773,21 +700,20 @@ export interface RestorableDroppedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorableDroppedDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link RestorableDroppedDatabase} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of deleted databases that can be restored + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -802,14 +728,14 @@ export interface RestorableDroppedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of deleted databases that can be restored + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -829,7 +755,7 @@ export interface RestorableDroppedDatabases { * * {Promise} A promise is returned. * - * @resolve {RestorableDroppedDatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -837,32 +763,37 @@ export interface RestorableDroppedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorableDroppedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RestorableDroppedDatabaseListResult} for - * more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Capabilities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Capabilities { + deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the capabilities available for the specified location. + * Updates a server. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -871,16 +802,32 @@ export interface Capabilities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the capabilities available for the specified location. + * Updates a server. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -894,7 +841,7 @@ export interface Capabilities { * * {Promise} A promise is returned. * - * @resolve {LocationCapabilities} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -902,29 +849,20 @@ export interface Capabilities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. - * See {@link LocationCapabilities} for more information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByLocation(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocation(locationId: string, callback: ServiceCallback): void; - listByLocation(locationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerConnectionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerConnectionPolicies { + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates the server's connection policy. + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -932,11 +870,27 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for updating a secure - * connection policy. + * @param {object} parameters The requested server resource state. * - * @param {string} parameters.connectionType The server connection type. - * Possible values include: 'Default', 'Proxy', 'Redirect' + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -945,14 +899,14 @@ export interface ServerConnectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates the server's connection policy. + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -960,25 +914,41 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for updating a secure - * connection policy. - * - * @param {string} parameters.connectionType The server connection type. - * Possible values include: 'Default', 'Proxy', 'Redirect' + * @param {object} parameters The requested server resource state. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. * * @returns {ServiceCallback|Promise} If a callback was passed as the last * parameter then it returns the callback else returns a Promise. * * {Promise} A promise is returned. * - * @resolve {ServerConnectionPolicy} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -986,21 +956,20 @@ export interface ServerConnectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerConnectionPolicy} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the server's secure connection policy. + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1015,14 +984,14 @@ export interface ServerConnectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the server's secure connection policy. + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1042,7 +1011,7 @@ export interface ServerConnectionPolicies { * * {Promise} A promise is returned. * - * @resolve {ServerConnectionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1050,30 +1019,19 @@ export interface ServerConnectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerConnectionPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseThreatDetectionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseThreatDetectionPolicies { + beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's threat detection policy. + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1081,8 +1039,17 @@ export interface DatabaseThreatDetectionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1091,14 +1058,14 @@ export interface DatabaseThreatDetectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's threat detection policy. + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1106,8 +1073,17 @@ export interface DatabaseThreatDetectionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1121,7 +1097,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1129,127 +1105,99 @@ export interface DatabaseThreatDetectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database's threat detection policy. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. - * - * @param {object} parameters The database Threat Detection policy. - * - * @param {string} [parameters.location] The geo-location where the resource - * lives - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' + * Gets a list of all servers in the subscription. * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of all servers in the subscription. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a database's threat detection policy. + * {Promise} A promise is returned. * - * @param {string} 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. + * @resolve {ServerListResult} - The deserialized result object. * - * @param {string} serverName The name of the server. + * @reject {Error|ServiceError} - The error object. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} parameters The database Threat Detection policy. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.location] The geo-location where the resource - * lives + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of servers in a resource groups. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. + * @returns {Promise} A promise is returned * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of servers in a resource groups. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1263,7 +1211,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1271,30 +1219,29 @@ export interface DatabaseThreatDetectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DataMaskingPolicies + * ServerConnectionPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DataMaskingPolicies { +export interface ServerConnectionPolicies { /** - * Creates or updates a database data masking policy + * Creates or updates the server's connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1302,18 +1249,11 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. - * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' + * @param {object} parameters The required parameters for updating a secure + * connection policy. * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. + * @param {string} parameters.connectionType The server connection type. + * Possible values include: 'Default', 'Proxy', 'Redirect' * * @param {object} [options] Optional Parameters. * @@ -1322,14 +1262,14 @@ export interface DataMaskingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking policy + * Creates or updates the server's connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1337,18 +1277,11 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. - * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' + * @param {object} parameters The required parameters for updating a secure + * connection policy. * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. + * @param {string} parameters.connectionType The server connection type. + * Possible values include: 'Default', 'Proxy', 'Redirect' * * @param {object} [options] Optional Parameters. * @@ -1362,7 +1295,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {ServerConnectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1370,20 +1303,21 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerConnectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database data masking policy. + * Gets the server's secure connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1391,8 +1325,6 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1400,14 +1332,14 @@ export interface DataMaskingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database data masking policy. + * Gets the server's secure connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1415,8 +1347,6 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1429,7 +1359,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {ServerConnectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1437,29 +1367,30 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerConnectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DataMaskingRules + * Databases * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DataMaskingRules { +export interface Databases { /** - * Creates or updates a database data masking rule. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1467,55 +1398,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} dataMaskingRuleName The name of the data masking rule. - * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. - * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. - * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. - * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. - * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. - * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' - * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -1524,14 +1407,14 @@ export interface DataMaskingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking rule. + * Pauses a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1539,55 +1422,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} dataMaskingRuleName The name of the data masking rule. - * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. - * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. - * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. - * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. - * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. - * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' - * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * @param {string} databaseName The name of the data warehouse to pause. * * @param {object} [options] Optional Parameters. * @@ -1601,7 +1436,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1609,20 +1444,19 @@ export interface DataMaskingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingRule} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingRule} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + pause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + pause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + pause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database data masking rules. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1630,7 +1464,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -1639,14 +1473,14 @@ export interface DataMaskingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database data masking rules. + * Resumes a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1654,7 +1488,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the data warehouse to resume. * * @param {object} [options] Optional Parameters. * @@ -1668,7 +1502,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1676,30 +1510,19 @@ export interface DataMaskingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingRuleListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FirewallRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface FirewallRules { + resume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + resume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a firewall rule. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1707,34 +1530,162 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * a database. * - * @param {string} parameters.startIpAddress The start IP address of the - * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - * Azure-internal IP addresses. + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {string} parameters.endIpAddress The end IP address of the firewall - * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. - * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {object} [options] Optional Parameters. + * Default: regular database creation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @returns {Promise} A promise is returned + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a firewall rule. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1742,61 +1693,3240 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database to be operated on + * (updated or created). * * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * a database. * - * @param {string} parameters.startIpAddress The start IP address of the - * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - * Azure-internal IP addresses. + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. * - * @param {string} parameters.endIpAddress The end IP address of the firewall - * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. - * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be updated. + * + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be updated. + * + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns a list of databases in a server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * + * @param {string} [options.filter] An OData filter expression that describes a + * subset of databases to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns a list of databases in a server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] A comma separated list of child objects to + * expand in the response. Possible properties: serviceTierAdvisors, + * transparentDataEncryption. + * + * @param {string} [options.filter] An OData filter expression that describes a + * subset of databases to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database inside of an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database inside of an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, callback: ServiceCallback): void; + getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns a list of databases in an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns a list of databases in an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database inside of a recommented elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} recommendedElasticPoolName The name of the elastic pool to + * be retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database inside of a recommented elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} recommendedElasticPoolName The name of the elastic pool to + * be retrieved. + * + * @param {string} databaseName The name of the database to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, callback: ServiceCallback): void; + getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns a list of databases inside a recommented elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns a list of databases inside a recommented elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns database metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns database metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns database metric definitions. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns database metric definitions. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MetricDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Renames a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Renames a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Pauses a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the data warehouse to pause. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Pauses a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the data warehouse to pause. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resumes a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the data warehouse to resume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resumes a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the data warehouse to resume. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new database or updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be operated on + * (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * a database. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new database or updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be operated on + * (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * a database. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be updated. + * + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be updated. + * + * @param {object} parameters The required parameters for updating a database. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.collation] The collation of the database. If + * createMode is not Default, this value is ignored. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or + * nonreadable) secondary replica of an existing database. sourceDatabaseId + * must be specified as the resource ID of the existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, NonReadableSecondary, OnlineSecondary and + * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. + * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', + * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', + * 'RestoreLongTermRetentionBackup' + * + * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is + * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, + * or Restore, then this value is required. Specifies the resource ID of the + * source database. If createMode is NonReadableSecondary or OnlineSecondary, + * the name of the source database must be the same as the new database being + * created. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If + * createMode is Restore and sourceDatabaseId is the deleted database's + * original resource id when it existed (as opposed to its current restorable + * dropped database id), then this value is required. Specifies the time that + * the database was deleted. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. If createMode is Restore, this + * value is optional. Specifies the point in time (ISO8601 format) of the + * source database that will be restored to create the new database. Must be + * greater than or equal to the source database's earliestRestoreDate value. + * + * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] + * Conditional. If createMode is RestoreLongTermRetentionBackup, then this + * value is required. Specifies the resource ID of the recovery point to + * restore from. + * + * @param {string} [parameters.edition] The edition of the database. The + * DatabaseEditions enumeration contains all the valid editions. If createMode + * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see + * possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions -l westus --query [].name`. Possible + * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * + * @param {string} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. If createMode is not Default, this value is ignored. To + * see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." + * + * @param {uuid} [parameters.requestedServiceObjectiveId] The configured + * service level objective ID of the database. This is the service level + * objective that is in the process of being applied to the database. Once + * successfully updated, it will match the value of currentServiceObjectiveId + * property. If requestedServiceObjectiveId and requestedServiceObjectiveName + * are both updated, the value of requestedServiceObjectiveId overrides the + * value of requestedServiceObjectiveName. To see possible values, query the + * capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name` . + * + * @param {string} [parameters.requestedServiceObjectiveName] The name of the + * configured service level objective of the database. This is the service + * level objective that is in the process of being applied to the database. + * Once successfully updated, it will match the value of serviceLevelObjective + * property. To see possible values, query the capabilities API + * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + * referred to by operationId: "Capabilities_ListByLocation." or use the Azure + * CLI command `az sql db list-editions --location --query + * [].supportedServiceLevelObjectives[].name`. Possible values include: + * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} [parameters.elasticPoolName] The name of the elastic pool + * the database is in. If elasticPoolName and requestedServiceObjectiveName are + * both updated, the value of requestedServiceObjectiveName is ignored. Not + * supported for DataWarehouse edition. + * + * @param {string} [parameters.readScale] Conditional. If the database is a + * geo-secondary, readScale indicates whether read-only connections are allowed + * to this database or not. Not supported for DataWarehouse edition. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.sampleName] Indicates the name of the sample + * schema to apply when creating this database. If createMode is not Default, + * this value is ignored. Not supported for DataWarehouse edition. Possible + * values include: 'AdventureWorksLT' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseThreatDetectionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseThreatDetectionPolicies { + + + /** + * Gets a database's threat detection policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database's threat detection policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseSecurityAlertPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a database's threat detection policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} parameters The database Threat Detection policy. + * + * @param {string} [parameters.location] The geo-location where the resource + * lives + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'New', 'Enabled', 'Disabled' + * + * @param {string} [parameters.disabledAlerts] Specifies the + * semicolon-separated list of alerts that are disabled, or empty string to + * disable no alerts. Possible values: Sql_Injection; + * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * + * @param {string} [parameters.emailAddresses] Specifies the + * semicolon-separated list of e-mail addresses to which the alert is sent. + * + * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. If state is Enabled, + * storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. If state is + * Enabled, storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {string} [parameters.useServerDefault] Specifies whether to use the + * default server policy. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a database's threat detection policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} parameters The database Threat Detection policy. + * + * @param {string} [parameters.location] The geo-location where the resource + * lives + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'New', 'Enabled', 'Disabled' + * + * @param {string} [parameters.disabledAlerts] Specifies the + * semicolon-separated list of alerts that are disabled, or empty string to + * disable no alerts. Possible values: Sql_Injection; + * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * + * @param {string} [parameters.emailAddresses] Specifies the + * semicolon-separated list of e-mail addresses to which the alert is sent. + * + * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. If state is Enabled, + * storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. If state is + * Enabled, storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {string} [parameters.useServerDefault] Specifies whether to use the + * default server policy. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseSecurityAlertPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DataMaskingPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DataMaskingPolicies { + + + /** + * Creates or updates a database data masking policy + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters Parameters for creating or updating a data + * masking policy. + * + * @param {string} parameters.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.exemptPrincipals] The list of the exempt + * principals. Specifies the semicolon-separated list of database users for + * which the data masking policy does not apply. The specified users receive + * data results without masking for all of the database queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a database data masking policy + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters Parameters for creating or updating a data + * masking policy. + * + * @param {string} parameters.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' + * + * @param {string} [parameters.exemptPrincipals] The list of the exempt + * principals. Specifies the semicolon-separated list of database users for + * which the data masking policy does not apply. The specified users receive + * data results without masking for all of the database queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMaskingPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database data masking policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database data masking policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMaskingPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingPolicy} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DataMaskingRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DataMaskingRules { + + + /** + * Creates or updates a database data masking rule. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. * - * {Promise} A promise is returned. + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. * - * @resolve {FirewallRule} - The deserialized result object. + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a firewall rule. + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * @param {string} 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 {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. * * @param {object} [options] Optional Parameters. * @@ -1805,14 +4935,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a firewall rule. + * Creates or updates a database data masking rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1820,7 +4950,55 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. + * + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. + * + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. + * + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. + * + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. + * + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. + * + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' + * + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. * * @param {object} [options] Optional Parameters. * @@ -1834,7 +5012,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DataMaskingRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1842,19 +5020,20 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DataMaskingRule} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a firewall rule. + * Gets a list of database data masking rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1862,7 +5041,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1871,14 +5050,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a firewall rule. + * Gets a list of database data masking rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1886,7 +5065,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1900,7 +5079,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {DataMaskingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1908,20 +5087,30 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. + * {DataMaskingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingRuleListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPools { /** - * Returns a list of firewall rules. + * Creates a new elastic pool or updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1929,6 +5118,35 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * an elastic pool. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1936,14 +5154,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of firewall rules. + * Creates a new elastic pool or updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1951,6 +5169,35 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). + * + * @param {object} parameters The required parameters for creating or updating + * an elastic pool. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1963,7 +5210,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRuleListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1971,44 +5218,52 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRuleListResult} for more - * information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * GeoBackupPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface GeoBackupPolicies { + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a database geo backup policy. + * Updates an existing elastic pool. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool to be updated. + * + * @param {object} parameters The required parameters for updating an elastic + * pool. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. * - * @param {string} databaseName The name of the database. + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. * - * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -2017,14 +5272,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database geo backup policy. + * Updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2032,13 +5287,31 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be updated. * - * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. + * @param {object} parameters The required parameters for updating an elastic + * pool. * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -2052,7 +5325,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2060,20 +5333,20 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a geo backup policy. + * Deletes the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2081,7 +5354,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be deleted. * * @param {object} [options] Optional Parameters. * @@ -2090,14 +5363,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a geo backup policy. + * Deletes the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2105,7 +5378,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be deleted. * * @param {object} [options] Optional Parameters. * @@ -2119,7 +5392,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2127,20 +5400,19 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of geo backup policies. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2148,7 +5420,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * * @param {object} [options] Optional Parameters. * @@ -2157,14 +5430,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of geo backup policies. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2172,7 +5445,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be + * retrieved. * * @param {object} [options] Optional Parameters. * @@ -2186,7 +5460,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicyListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2194,30 +5468,20 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicyListResult} for more - * information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Databases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Databases { + get(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Imports a bacpac into a new database. + * Returns a list of elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2225,40 +5489,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2266,14 +5496,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Imports a bacpac into a new database. + * Returns a list of elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2281,40 +5511,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2327,7 +5523,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2335,21 +5531,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {ElasticPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2357,31 +5552,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -2390,47 +5564,25 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + /** + * Returns elastic pool metrics. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} 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 {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} serverName The name of the server. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -2444,7 +5596,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {MetricListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2452,20 +5604,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Exports a database to a bacpac. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2473,26 +5625,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -2501,14 +5634,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2516,26 +5649,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -2549,7 +5663,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2557,20 +5671,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database metrics. + * Creates a new elastic pool or updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2578,10 +5693,34 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The required parameters for creating or updating + * an elastic pool. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -2590,14 +5729,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metrics. + * Creates a new elastic pool or updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2605,10 +5744,34 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The required parameters for creating or updating + * an elastic pool. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -2622,7 +5785,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2630,20 +5793,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database metric definitions. + * Updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2651,7 +5814,31 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be updated. + * + * @param {object} parameters The required parameters for updating an elastic + * pool. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -2660,14 +5847,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metric definitions. + * Updates an existing elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2675,7 +5862,31 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName The name of the elastic pool to be updated. + * + * @param {object} parameters The required parameters for updating an elastic + * pool. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' + * + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. + * + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. + * + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. + * + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database + * elastic pool is zone redundant, which means the replicas of this database + * will be spread across multiple availability zones. * * @param {object} [options] Optional Parameters. * @@ -2689,7 +5900,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2697,21 +5908,29 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FirewallRules { /** - * Pauses a data warehouse. + * Creates or updates a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2719,7 +5938,18 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} firewallRuleName The name of the firewall rule. + * + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address of the + * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all + * Azure-internal IP addresses. + * + * @param {string} parameters.endIpAddress The end IP address of the firewall + * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. + * Use value '0.0.0.0' to represent all Azure-internal IP addresses. * * @param {object} [options] Optional Parameters. * @@ -2728,14 +5958,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * Creates or updates a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2743,7 +5973,18 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} firewallRuleName The name of the firewall rule. + * + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address of the + * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all + * Azure-internal IP addresses. + * + * @param {string} parameters.endIpAddress The end IP address of the firewall + * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. + * Use value '0.0.0.0' to represent all Azure-internal IP addresses. * * @param {object} [options] Optional Parameters. * @@ -2757,7 +5998,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2765,19 +6006,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - pause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - pause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resumes a data warehouse. + * Deletes a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2785,7 +6027,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2798,10 +6040,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * Deletes a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2809,7 +6051,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2837,291 +6079,45 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - resume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - resume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * Creates a new database or updates an existing database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * Gets a firewall rule. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} firewallRuleName The name of the firewall rule. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options] Optional Parameters. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a firewall rule. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} 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 {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server. * - * @param {string} parameters.location Resource location. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -3135,7 +6131,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3143,20 +6139,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing database. + * Returns a list of firewall rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3164,126 +6160,86 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.tags] Resource tags. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns a list of firewall rules. * - * Default: regular database creation. + * @param {string} 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. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} serverName The name of the server. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {object} [options] Optional Parameters. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {Promise} A promise is returned. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @resolve {FirewallRuleListResult} - The deserialized result object. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @reject {Error|ServiceError} - The error object. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRuleListResult} for more + * information. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * GeoBackupPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface GeoBackupPolicies { + + + /** + * Updates a database geo backup policy. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} 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 {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {string} serverName The name of the server. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * * @param {object} [options] Optional Parameters. * @@ -3292,14 +6248,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * Updates a database geo backup policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3307,126 +6263,80 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Default: regular database creation. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * {Promise} A promise is returned. + * + * @resolve {GeoBackupPolicy} - The deserialized result object. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @reject {Error|ServiceError} - The error object. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicy} for more information. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a geo backup policy. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {string} 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 {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @returns {Promise} A promise is returned * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a geo backup policy. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} 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 {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3440,7 +6350,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3448,20 +6358,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicy} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a database. + * Returns a list of geo backup policies. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3469,7 +6379,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3478,14 +6388,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a database. + * Returns a list of geo backup policies. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3493,7 +6403,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3507,7 +6417,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {GeoBackupPolicyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3515,19 +6425,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {GeoBackupPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicyListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ReplicationLinks + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ReplicationLinks { /** - * Gets a database. + * Deletes a database replication link. Cannot be done during failover. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3535,27 +6456,26 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be dropped. * - * @param {object} [options] Optional Parameters. + * @param {string} linkId The ID of the replication link to be deleted. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database. + * Deletes a database replication link. Cannot be done during failover. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3563,13 +6483,12 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be dropped. * - * @param {object} [options] Optional Parameters. + * @param {string} linkId The ID of the replication link to be deleted. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3581,7 +6500,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3589,20 +6508,19 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases in a server. + * Gets a database replication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3610,28 +6528,25 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database to get the link for. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} linkId The replication link ID to be retrieved. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in a server. + * Gets a database replication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3639,14 +6554,11 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database to get the link for. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} linkId The replication link ID to be retrieved. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3658,7 +6570,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ReplicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3666,20 +6578,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {ReplicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicationLink} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database inside of an elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3687,10 +6600,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3699,14 +6612,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of an elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3714,10 +6628,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3731,7 +6645,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3739,20 +6653,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, callback: ServiceCallback): void; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases in an elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3760,8 +6674,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3770,14 +6686,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in an elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3785,8 +6702,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3800,7 +6719,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3808,20 +6727,19 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database inside of a recommented elastic pool. + * Lists a database's replication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3829,10 +6747,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to retrieve links for. * * @param {object} [options] Optional Parameters. * @@ -3841,14 +6756,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of a recommented elastic pool. + * Lists a database's replication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3856,10 +6771,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to retrieve links for. * * @param {object} [options] Optional Parameters. * @@ -3873,7 +6785,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ReplicationLinkListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3881,20 +6793,22 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {ReplicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicationLinkListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, callback: ServiceCallback): void; - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases inside a recommented elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3902,8 +6816,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3912,14 +6828,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases inside a recommented elastic pool. + * Sets which replica database is primary by failing over from the current + * primary replica database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3927,8 +6844,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -3942,7 +6861,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3950,20 +6869,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Imports a bacpac into a new database. + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3971,39 +6890,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -4012,14 +6902,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Imports a bacpac into a new database. + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4027,39 +6918,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} linkId The ID of the replication link to be failed over. * * @param {object} [options] Optional Parameters. * @@ -4073,7 +6935,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4081,21 +6943,29 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; - beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerAzureADAdministrators + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerAzureADAdministrators { /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4103,31 +6973,15 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} properties.login The server administrator login value. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {uuid} properties.sid The server administrator Sid (Secure ID). * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * * @param {object} [options] Optional Parameters. * @@ -4136,47 +6990,31 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} 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 {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} serverName The name of the server. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} properties.login The server administrator login value. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {uuid} properties.sid The server administrator Sid (Secure ID). * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * * @param {object} [options] Optional Parameters. * @@ -4190,7 +7028,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4198,20 +7036,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; - beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Exports a database to a bacpac. + * Deletes an existing server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4219,27 +7058,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4247,14 +7065,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * Deletes an existing server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4262,27 +7080,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4295,7 +7092,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4303,20 +7100,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; - beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Pauses a data warehouse. + * Returns an server Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4324,8 +7122,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4333,14 +7129,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * Returns an server Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4348,8 +7144,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4362,7 +7156,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4370,19 +7164,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resumes a data warehouse. + * Returns a list of server Administrators. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4390,8 +7186,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4399,14 +7193,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * Returns a list of server Administrators. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4414,8 +7208,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4428,7 +7220,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAdministratorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4436,150 +7228,38 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerAdministratorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAdministratorListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginResume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginResume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - beginResume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new database or updates an existing database. + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} serverName The name of the server. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} properties.login The server administrator login value. * - * @param {string} parameters.location Resource location. + * @param {uuid} properties.sid The server administrator Sid (Secure ID). + * + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * * @param {object} [options] Optional Parameters. * @@ -4588,14 +7268,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4603,130 +7284,79 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} properties.login The server administrator login value. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {uuid} properties.sid The server administrator Sid (Secure ID). * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * - * Default: regular database creation. + * @param {object} [options] Optional Parameters. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {Promise} A promise is returned. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @reject {Error|ServiceError} - The error object. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an existing server Active Directory Administrator. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} 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 {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} serverName The name of the server. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing server Active Directory Administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} 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 {string} parameters.location Resource location. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -4740,7 +7370,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4748,20 +7378,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerCommunicationLinks + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerCommunicationLinks { /** - * Updates an existing database. + * Deletes a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4769,126 +7409,76 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} communicationLinkName The name of the server communication + * link. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Default: regular database creation. + * @returns {Promise} A promise is returned * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a server communication link. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} 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. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} serverName The name of the server. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {string} communicationLinkName The name of the server communication + * link. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {object} [options] Optional Parameters. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * {Promise} A promise is returned. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @resolve {null} - The deserialized result object. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @reject {Error|ServiceError} - The error object. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns a server communication link. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -4897,14 +7487,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * Returns a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4912,126 +7502,88 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} communicationLinkName The name of the server communication + * link. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * Default: regular database creation. + * {Promise} A promise is returned. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @resolve {ServerCommunicationLink} - The deserialized result object. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @reject {Error|ServiceError} - The error object. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more + * information. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a server communication link. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @param {string} 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 {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {string} serverName The name of the server. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @param {string} communicationLinkName The name of the server communication + * link. * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @param {object} parameters The required parameters for creating a server + * communication link. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} parameters.partnerServer The name of the partner server. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options] Optional Parameters. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a server communication link. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5045,7 +7597,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5053,29 +7605,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPools { + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool metrics. + * Gets a list of server communication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5083,11 +7627,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5095,14 +7634,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metrics. + * Gets a list of server communication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5110,11 +7649,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5127,7 +7661,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5135,20 +7669,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLinkListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool metric definitions. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5156,7 +7691,13 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5165,14 +7706,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metric definitions. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5180,7 +7721,13 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5194,7 +7741,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5202,21 +7749,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServiceObjectives + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServiceObjectives { /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5224,30 +7780,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -5256,14 +7790,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5271,30 +7805,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -5308,7 +7820,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServiceObjective} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5316,20 +7828,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServiceObjective} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjective} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5337,28 +7849,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5366,14 +7856,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5381,28 +7871,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5415,7 +7883,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServiceObjectiveListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5423,20 +7891,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjectiveListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolActivities { /** - * Deletes the elastic pool. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5444,7 +7922,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5453,14 +7932,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the elastic pool. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5468,7 +7947,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5482,7 +7962,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5490,19 +7970,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolActivityListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolDatabaseActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolDatabaseActivities { /** - * Gets an elastic pool. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5510,8 +8001,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5520,14 +8010,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an elastic pool. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5535,8 +8025,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5550,7 +8039,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5558,20 +8047,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolDatabaseActivityListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RecommendedElasticPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface RecommendedElasticPools { /** - * Returns a list of elastic pools in a server. + * Gets a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5579,6 +8078,9 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5586,14 +8088,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of elastic pools in a server. + * Gets a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5601,6 +8103,9 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5613,7 +8118,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @resolve {RecommendedElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5621,20 +8126,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolListResult} for more information. + * {RecommendedElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPool} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns recommended elastic pools. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5642,31 +8148,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5674,14 +8155,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns recommended elastic pools. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5689,31 +8170,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5726,7 +8182,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5734,20 +8190,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {RecommendedElasticPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPoolListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. + * Returns recommented elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5755,27 +8212,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5784,14 +8222,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * Returns recommented elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5799,27 +8237,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5833,7 +8252,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {RecommendedElasticPoolListMetricsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5841,29 +8260,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {RecommendedElasticPoolListMetricsResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPoolListMetricsResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ReplicationLinks + * ServiceTierAdvisors * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ReplicationLinks { +export interface ServiceTierAdvisors { /** - * Deletes a database replication link. Cannot be done during failover. + * Gets a service tier advisor. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5871,10 +8291,9 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be dropped. + * @param {string} databaseName The name of database. * - * @param {string} linkId The ID of the replication link to be deleted. + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5883,14 +8302,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a database replication link. Cannot be done during failover. + * Gets a service tier advisor. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5898,10 +8317,9 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be dropped. + * @param {string} databaseName The name of database. * - * @param {string} linkId The ID of the replication link to be deleted. + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5915,7 +8333,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceTierAdvisor} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5923,19 +8341,20 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServiceTierAdvisor} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTierAdvisor} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database replication link. + * Returns service tier advisors for specified database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5943,9 +8362,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get the link for. - * - * @param {string} linkId The replication link ID to be retrieved. + * @param {string} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -5954,14 +8371,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database replication link. + * Returns service tier advisors for specified database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5969,9 +8386,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get the link for. - * - * @param {string} linkId The replication link ID to be retrieved. + * @param {string} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -5985,7 +8400,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLink} - The deserialized result object. + * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5993,21 +8408,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ReplicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ReplicationLink} for more information. + * {ServiceTierAdvisorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTierAdvisorListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TransparentDataEncryptions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface TransparentDataEncryptions { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Creates or updates a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6015,10 +8439,14 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {object} parameters The required parameters for creating or updating + * transparent data encryption. + * + * @param {string} [parameters.status] The status of the database transparent + * data encryption. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -6027,15 +8455,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Creates or updates a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6043,10 +8470,14 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {object} parameters The required parameters for creating or updating + * transparent data encryption. + * + * @param {string} [parameters.status] The status of the database transparent + * data encryption. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -6060,7 +8491,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6068,20 +8499,21 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryption} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Gets a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6089,10 +8521,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6101,15 +8531,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Gets a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6117,10 +8546,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6134,7 +8561,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6142,19 +8569,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryption} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TransparentDataEncryptionActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface TransparentDataEncryptionActivities { /** - * Lists a database's replication links. + * Returns a database's transparent data encryption operation result. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6162,7 +8600,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to retrieve links for. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6171,14 +8610,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByConfigurationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists a database's replication links. + * Returns a database's transparent data encryption operation result. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6186,7 +8625,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to retrieve links for. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6200,7 +8640,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLinkListResult} - The deserialized result object. + * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6208,22 +8648,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ReplicationLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReplicationLinkListResult} for more - * information. + * {TransparentDataEncryptionActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryptionActivityListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerUsages + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerUsages { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns server usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6231,11 +8679,6 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6243,15 +8686,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns server usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6259,11 +8701,6 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6276,7 +8713,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6284,20 +8721,29 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerUsageListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseUsages + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseUsages { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Returns database usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6305,10 +8751,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6317,15 +8760,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Returns database usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6333,10 +8775,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6350,7 +8789,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6358,29 +8797,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseUsageListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ServerAzureADAdministrators + * DatabaseBlobAuditingPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ServerAzureADAdministrators { +export interface DatabaseBlobAuditingPolicies { /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Gets a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6388,15 +8828,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -6405,15 +8838,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Gets a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6421,15 +8853,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -6443,7 +8868,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6451,21 +8876,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes an existing server Active Directory Administrator. + * Creates or updates a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6473,6 +8898,35 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6480,14 +8934,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * Creates or updates a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6495,6 +8949,35 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6507,7 +8990,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6515,21 +8998,30 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseAutomaticTuningOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseAutomaticTuningOperations { /** - * Returns an server Administrator. + * Gets a database's automatic tuning. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6537,6 +9029,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6544,14 +9038,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an server Administrator. + * Gets a database's automatic tuning. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6559,6 +9053,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6571,7 +9067,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6579,21 +9075,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of server Administrators. + * Update automatic tuning properties for target database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6601,6 +9097,15 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6608,14 +9113,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of server Administrators. + * Update automatic tuning properties for target database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6623,6 +9128,15 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6635,7 +9149,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAdministratorListResult} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6643,22 +9157,30 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAdministratorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAdministratorListResult} for more + * {DatabaseAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * EncryptionProtectors + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface EncryptionProtectors { /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Gets a list of server encryption protectors * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6666,16 +9188,6 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6683,15 +9195,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Gets a list of server encryption protectors * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6699,16 +9210,6 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6721,7 +9222,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6729,21 +9230,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtectorListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes an existing server Active Directory Administrator. + * Gets a server encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6758,14 +9259,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * Gets a server encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6785,7 +9286,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6793,30 +9294,20 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more - * information. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerCommunicationLinks - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerCommunicationLinks { + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6824,8 +9315,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6834,14 +9334,14 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6849,8 +9349,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6864,7 +9373,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6872,19 +9381,20 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6892,8 +9402,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6902,14 +9421,14 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6917,8 +9436,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6932,7 +9460,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6940,35 +9468,23 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a server communication link. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * Gets a list of server encryption protectors * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6977,28 +9493,17 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * Gets a list of server encryption protectors * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7012,7 +9517,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7020,27 +9525,39 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more + * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtectorListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FailoverGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FailoverGroups { /** - * Gets a list of server communication links. + * Gets a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7049,20 +9566,23 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server communication links. + * Gets a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7076,7 +9596,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7084,35 +9604,60 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLinkListResult} for more - * information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a server communication link. + * Creates or updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {string} failoverGroupName The name of the failover group. * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {object} parameters The failover group parameters. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7121,28 +9666,54 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. + * Creates or updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {string} failoverGroupName The name of the failover group. * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {object} parameters The failover group parameters. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7156,7 +9727,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7164,39 +9735,29 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceObjectives - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServiceObjectives { + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database service objective. + * Deletes a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7205,23 +9766,23 @@ export interface ServiceObjectives { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database service objective. + * Deletes a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7235,7 +9796,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjective} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7243,26 +9804,56 @@ export interface ServiceObjectives { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceObjective} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjective} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database service objectives. + * Updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7271,20 +9862,51 @@ export interface ServiceObjectives { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database service objectives. + * Updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7298,7 +9920,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjectiveListResult} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7306,35 +9928,27 @@ export interface ServiceObjectives { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjectiveListResult} for more - * information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Servers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Servers { + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Determines whether a resource can be created with the specified name. + * Lists the failover groups in a server. * - * @param {object} parameters The parameters to request for name availability. + * @param {string} 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 {string} parameters.name The name whose availability is to be - * checked. + * @param {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7343,19 +9957,21 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Determines whether a resource can be created with the specified name. + * Lists the failover groups in a server. * - * @param {object} parameters The parameters to request for name availability. + * @param {string} 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 {string} parameters.name The name whose availability is to be - * checked. + * @param {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7369,7 +9985,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {CheckNameAvailabilityResponse} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7377,21 +9993,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. - * See {@link CheckNameAvailabilityResponse} for more + * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, callback: ServiceCallback): void; - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of all servers in the subscription. + * Fails over from the current primary server to this server. + * + * @param {string} 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 {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7400,14 +10025,23 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all servers in the subscription. + * Fails over from the current primary server to this server. + * + * @param {string} 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 {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7421,7 +10055,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7429,25 +10063,31 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of servers in a resource groups. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} 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 {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7455,19 +10095,25 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of servers in a resource groups. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} 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 {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7480,7 +10126,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7488,26 +10134,60 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server. + * Creates or updates a failover group. + * + * @param {string} 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 {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' * - * @param {string} 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 {array} parameters.partnerServers List of partner server information + * for the failover group. * - * @param {string} serverName The name of the server. + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7516,20 +10196,54 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server. + * Creates or updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7543,7 +10257,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7551,48 +10265,29 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server. + * Deletes a failover group. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7601,42 +10296,23 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server. + * Deletes a failover group. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7650,7 +10326,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7658,26 +10334,56 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server. + * Updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7686,20 +10392,51 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server. + * Updates a failover group. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7713,7 +10450,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7721,37 +10458,29 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a server. + * Fails over from the current primary server to this server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7760,32 +10489,23 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server. + * Fails over from the current primary server to this server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7799,7 +10519,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7807,48 +10527,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7857,42 +10559,24 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7906,7 +10590,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7914,26 +10598,23 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server. - * - * @param {string} 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. + * Lists the failover groups in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7942,20 +10623,17 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server. - * - * @param {string} 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. + * Lists the failover groups in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7969,7 +10647,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7977,37 +10655,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Operations { /** - * Updates a server. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -8016,32 +10687,14 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -8055,7 +10708,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8063,20 +10716,20 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of all servers in the subscription. + * Lists all of the available SQL Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8088,14 +10741,14 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all servers in the subscription. + * Lists all of the available SQL Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8112,7 +10765,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8120,23 +10773,35 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerKeys + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerKeys { /** - * Gets a list of servers in a resource groups. + * Gets a list of server keys. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -8145,17 +10810,20 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of servers in a resource groups. + * Gets a list of server keys. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -8169,37 +10837,28 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * * {ServiceCallback} optionalCallback(err, result, request, response) * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPoolActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolActivities { + * + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool activities. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8207,8 +10866,7 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -8217,14 +10875,14 @@ export interface ElasticPoolActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool activities. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8232,8 +10890,7 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -8247,7 +10904,7 @@ export interface ElasticPoolActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolActivityListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8255,30 +10912,20 @@ export interface ElasticPoolActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolActivityListResult} for more - * information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPoolDatabaseActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolDatabaseActivities { + get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns activity on databases inside of an elastic pool. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8286,7 +10933,27 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8295,14 +10962,14 @@ export interface ElasticPoolDatabaseActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns activity on databases inside of an elastic pool. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8310,7 +10977,27 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8324,7 +11011,7 @@ export interface ElasticPoolDatabaseActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8332,30 +11019,20 @@ export interface ElasticPoolDatabaseActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolDatabaseActivityListResult} for - * more information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RecommendedElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RecommendedElasticPools { + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a recommented elastic pool. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8363,8 +11040,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8373,14 +11049,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recommented elastic pool. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8388,8 +11064,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8403,7 +11078,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPool} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8411,21 +11086,19 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPool} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns recommended elastic pools. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8433,6 +11106,28 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8440,14 +11135,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommended elastic pools. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8455,6 +11150,28 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8467,7 +11184,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8475,21 +11192,20 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListResult} for more - * information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns recommented elastic pool metrics. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8497,8 +11213,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8507,14 +11222,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommented elastic pool metrics. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8522,8 +11237,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8537,7 +11251,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListMetricsResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8545,40 +11259,22 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListMetricsResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListMetricsResult} for - * more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceTierAdvisors - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServiceTierAdvisors { - - - /** - * Gets a service tier advisor. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of database. + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of server keys. * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8587,24 +11283,17 @@ export interface ServiceTierAdvisors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a service tier advisor. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of database. + * Gets a list of server keys. * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8618,7 +11307,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisor} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8626,28 +11315,38 @@ export interface ServiceTierAdvisors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceTierAdvisor} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceTierAdvisor} for more information. + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncAgents + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncAgents { /** - * Returns service tier advisors for specified database. + * Gets a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8656,22 +11355,23 @@ export interface ServiceTierAdvisors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns service tier advisors for specified database. + * Gets a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8685,7 +11385,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8693,45 +11393,34 @@ export interface ServiceTierAdvisors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceTierAdvisorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceTierAdvisorListResult} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * TransparentDataEncryptions - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface TransparentDataEncryptions { + get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database's transparent data encryption configuration. + * Creates or updates a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which setting the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {object} parameters The requested sync agent resource state. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8740,29 +11429,28 @@ export interface TransparentDataEncryptions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's transparent data encryption configuration. + * Creates or updates a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which setting the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {object} parameters The requested sync agent resource state. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8776,7 +11464,7 @@ export interface TransparentDataEncryptions { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryption} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8784,30 +11472,29 @@ export interface TransparentDataEncryptions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryption} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's transparent data encryption configuration. + * Deletes a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8816,23 +11503,23 @@ export interface TransparentDataEncryptions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's transparent data encryption configuration. + * Deletes a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8846,7 +11533,7 @@ export interface TransparentDataEncryptions { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryption} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8854,39 +11541,26 @@ export interface TransparentDataEncryptions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryption} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * TransparentDataEncryptionActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface TransparentDataEncryptionActivities { + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a database's transparent data encryption operation result. + * Lists sync agents in a server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8895,23 +11569,21 @@ export interface TransparentDataEncryptionActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByConfigurationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a database's transparent data encryption operation result. + * Lists sync agents in a server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8925,7 +11597,7 @@ export interface TransparentDataEncryptionActivities { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8933,36 +11605,29 @@ export interface TransparentDataEncryptionActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryptionActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryptionActivityListResult} - * for more information. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerUsages { + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns server usages. + * Generates a sync agent key. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. + * + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8971,20 +11636,23 @@ export interface ServerUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns server usages. + * Generates a sync agent key. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. + * + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8998,7 +11666,7 @@ export interface ServerUsages { * * {Promise} A promise is returned. * - * @resolve {ServerUsageListResult} - The deserialized result object. + * @resolve {SyncAgentKeyProperties} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9006,37 +11674,30 @@ export interface ServerUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerUsageListResult} for more information. + * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentKeyProperties} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseUsages { + */ + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database usages. + * Lists databases linked to a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9045,22 +11706,23 @@ export interface DatabaseUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database usages. + * Lists databases linked to a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9074,7 +11736,7 @@ export interface DatabaseUsages { * * {Promise} A promise is returned. * - * @resolve {DatabaseUsageListResult} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9082,39 +11744,35 @@ export interface DatabaseUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseUsageListResult} for more + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseBlobAuditingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseBlobAuditingPolicies { + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's blob auditing policy. + * Creates or updates a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} syncAgentName The name of the sync agent. + * + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9123,23 +11781,28 @@ export interface DatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's blob auditing policy. + * Creates or updates a sync agent. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} syncAgentName The name of the sync agent. + * + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9153,7 +11816,7 @@ export interface DatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9161,56 +11824,29 @@ export interface DatabaseBlobAuditingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database's blob auditing policy. + * Deletes a sync agent. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the blob - * auditing policy will be defined. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9219,49 +11855,23 @@ export interface DatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's blob auditing policy. + * Deletes a sync agent. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the blob - * auditing policy will be defined. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9275,7 +11885,7 @@ export interface DatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9283,36 +11893,22 @@ export interface DatabaseBlobAuditingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * EncryptionProtectors - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface EncryptionProtectors { + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server encryption protectors - * - * @param {string} 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. + * Lists sync agents in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9321,20 +11917,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server encryption protectors - * - * @param {string} 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. + * Lists sync agents in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9348,7 +11941,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtectorListResult} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9356,27 +11949,23 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtectorListResult} for more - * information. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server encryption protector. - * - * @param {string} 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. + * Lists databases linked to a sync agent. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9385,20 +11974,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server encryption protector. - * - * @param {string} 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. + * Lists databases linked to a sync agent. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9412,7 +11998,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9420,38 +12006,33 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; + listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncGroups { /** - * Updates an existing encryption protector. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Gets a collection of sync database ids. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9460,32 +12041,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Gets a collection of sync database ids. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9499,7 +12065,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9507,20 +12073,21 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; + listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing encryption protector. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -9528,17 +12095,10 @@ export interface EncryptionProtectors { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9547,14 +12107,14 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -9562,17 +12122,10 @@ export interface EncryptionProtectors { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9586,7 +12139,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9594,23 +12147,30 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server encryption protectors + * Gets a collection of hub database schemas. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9619,17 +12179,25 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server encryption protectors + * Gets a collection of hub database schemas. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9643,7 +12211,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtectorListResult} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9651,67 +12219,82 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtectorListResult} for more + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FailoverGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface FailoverGroups { + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a failover group. + * Gets a collection of sync group logs. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {string} startTime Get logs generated after this time. + * + * @param {string} endTime Get logs generated before this time. + * + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a failover group. + * Gets a collection of sync group logs. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {string} startTime Get logs generated after this time. + * + * @param {string} endTime Get logs generated before this time. + * + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9722,7 +12305,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9730,60 +12313,32 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a failover group. + * Cancels a sync group synchronization. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9792,54 +12347,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * Cancels a sync group synchronization. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9853,7 +12379,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9861,29 +12387,30 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a failover group. + * Triggers a sync group synchronization. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9896,19 +12423,21 @@ export interface FailoverGroups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a failover group. + * Triggers a sync group synchronization. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9936,50 +12465,24 @@ export interface FailoverGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a failover group. + * Gets a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9988,51 +12491,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a failover group. + * Gets a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10046,7 +12523,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10054,27 +12531,55 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the failover groups in a server. + * Creates or updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10083,21 +12588,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * Creates or updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10111,7 +12644,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10119,30 +12652,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroupListResult} for more - * information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. + * Deletes a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10151,23 +12685,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. + * Deletes a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10181,7 +12717,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10189,30 +12725,54 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10221,24 +12781,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10252,7 +12837,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10260,60 +12845,29 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a failover group. + * Lists sync groups under a hub database. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -10322,54 +12876,23 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * Lists sync groups under a hub database. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -10383,7 +12906,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10391,29 +12914,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a failover group. + * Refreshes a hub database schema. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10426,19 +12951,21 @@ export interface FailoverGroups { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a failover group. + * Refreshes a hub database schema. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10466,50 +12993,48 @@ export interface FailoverGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a failover group. + * Creates or updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The failover group parameters. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {object} [parameters.tags] Resource tags. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10518,51 +13043,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a failover group. + * Creates or updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The failover group parameters. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. + * @param {object} parameters The requested sync group resource state. * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10576,7 +13099,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10584,29 +13107,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. + * Deletes a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10615,23 +13140,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. + * Deletes a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10645,7 +13172,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10653,30 +13180,54 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10685,24 +13236,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Updates a sync group. * * @param {string} 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 {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10716,7 +13292,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10724,20 +13300,20 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the failover groups in a server. + * Gets a collection of sync database ids. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10749,14 +13325,14 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * Gets a collection of sync database ids. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10773,7 +13349,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10781,30 +13357,24 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroupListResult} for more + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Operations { + listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; + listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of hub database schemas. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10813,14 +13383,17 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of hub database schemas. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10834,7 +13407,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10842,20 +13415,21 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of sync group logs. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10867,14 +13441,14 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of sync group logs. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10891,7 +13465,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10899,35 +13473,24 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerKeys - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerKeys { + listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLogsNext(nextPageLink: string, callback: ServiceCallback): void; + listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server keys. - * - * @param {string} 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. + * Lists sync groups under a hub database. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10936,20 +13499,17 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. - * - * @param {string} 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. + * Lists sync groups under a hub database. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10963,7 +13523,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10971,20 +13531,29 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncMembers + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncMembers { /** - * Gets a server key. + * Gets a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -10992,7 +13561,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11001,14 +13576,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server key. + * Gets a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11016,7 +13591,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11030,7 +13611,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11038,20 +13619,20 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11059,27 +13640,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11088,14 +13682,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11103,27 +13697,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11137,7 +13744,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11145,20 +13752,20 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11166,7 +13773,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11179,10 +13792,10 @@ export interface ServerKeys { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11190,7 +13803,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11218,13 +13837,13 @@ export interface ServerKeys { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. + * Updates an existing sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11232,27 +13851,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11261,14 +13893,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Updates an existing sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11276,27 +13908,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11310,7 +13955,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11318,20 +13963,20 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Lists sync members in the given sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11339,7 +13984,10 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -11348,14 +13996,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Lists sync members in the given sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11363,7 +14011,10 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -11377,7 +14028,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11385,22 +14036,34 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server keys. + * Gets a sync member database schema. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11409,17 +14072,28 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. + * Gets a sync member database schema. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11433,7 +14107,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11441,38 +14115,35 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncAgents - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncAgents { + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync agent. + * Refreshes a sync member database schema. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11481,23 +14152,28 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync agent. + * Refreshes a sync member database schema. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11511,7 +14187,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11519,34 +14195,60 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. + * Creates or updates a sync member. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} 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 {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member * - * @param {object} parameters The requested sync agent resource state. + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11555,28 +14257,55 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Creates or updates a sync member. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested sync agent resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11590,7 +14319,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11598,29 +14327,34 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync agent. + * Deletes a sync member. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11633,19 +14367,24 @@ export interface SyncAgents { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Deletes a sync member. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11673,20 +14412,54 @@ export interface SyncAgents { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. + * Updates an existing sync member. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11695,21 +14468,55 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Updates an existing sync member. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11723,7 +14530,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11731,29 +14538,34 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates a sync agent key. + * Refreshes a sync member database schema. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11762,23 +14574,28 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates a sync agent key. + * Refreshes a sync member database schema. * * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11792,7 +14609,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentKeyProperties} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11800,30 +14617,22 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentKeyProperties} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * Lists sync members in the given sync group. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11832,23 +14641,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * Lists sync members in the given sync group. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11862,7 +14665,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11870,35 +14673,23 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more - * information. + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySyncGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listBySyncGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. - * - * @param {object} parameters The requested sync agent resource state. + * Gets a sync member database schema. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11907,28 +14698,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. - * - * @param {object} parameters The requested sync agent resource state. + * Gets a sync member database schema. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11942,7 +14722,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11950,29 +14730,33 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SubscriptionUsages + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SubscriptionUsages { /** - * Deletes a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * Gets all subscription usage metrics in a given location. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -11981,23 +14765,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. - * - * @param {string} 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 {string} serverName The name of the server on which the sync agent is - * hosted. + * Gets all subscription usage metrics in a given location. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -12011,7 +14789,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12019,22 +14797,26 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. + * Gets a subscription usage metric. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -12043,17 +14825,19 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Gets a subscription usage metric. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -12067,7 +14851,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {SubscriptionUsage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12075,20 +14859,20 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {SubscriptionUsage} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, usageName: string, callback: ServiceCallback): void; + get(locationName: string, usageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. + * Gets all subscription usage metrics in a given location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12100,14 +14884,14 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Gets all subscription usage metrics in a given location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12124,7 +14908,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12132,33 +14916,38 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; - listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * SyncGroups + * VirtualNetworkRules * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface SyncGroups { +export interface VirtualNetworkRules { /** - * Gets a collection of sync database ids. + * Gets a virtual network rule. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12167,17 +14956,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Gets a virtual network rule. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12191,7 +14985,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12199,21 +14993,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more - * information. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; - listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12221,10 +15014,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12233,14 +15032,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12248,10 +15047,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12265,7 +15070,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12273,19 +15078,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of hub database schemas. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12293,10 +15099,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12305,14 +15108,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12320,10 +15123,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12337,7 +15137,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12345,21 +15145,19 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync group logs. + * Gets a list of virtual network rules in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12367,36 +15165,21 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. - * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Gets a list of virtual network rules in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12404,23 +15187,8 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. - * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12431,7 +15199,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12439,21 +15207,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels a sync group synchronization. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12461,10 +15229,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12473,14 +15247,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels a sync group synchronization. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12488,10 +15262,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12505,7 +15285,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12513,19 +15293,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Triggers a sync group synchronization. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12533,10 +15314,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12549,10 +15327,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Triggers a sync group synchronization. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12560,10 +15338,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12591,24 +15366,16 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets a list of virtual network rules in a server. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12617,25 +15384,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets a list of virtual network rules in a server. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12649,7 +15408,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12657,55 +15416,38 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LongTermRetentionBackups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface LongTermRetentionBackups { /** - * Creates or updates a sync group. - * - * @param {string} 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. + * Gets a long term retention backup. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @param {string} locationName The location of the database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} longTermRetentionDatabaseName * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -12714,49 +15456,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * Gets a long term retention backup. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} locationName The location of the database. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} longTermRetentionDatabaseName * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -12770,7 +15485,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {LongTermRetentionBackup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12778,31 +15493,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync group. + * Deletes a long term retention backup. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName * - * @param {string} syncGroupName The name of the sync group. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -12815,21 +15528,18 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * Deletes a long term retention backup. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName * - * @param {string} syncGroupName The name of the sync group. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -12857,101 +15567,57 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. + * Lists all long term retention backups for a database. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {string} locationName The location of the database * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} longTermRetentionServerName * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionDatabaseName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. - * - * @param {string} 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. + * Lists all long term retention backups for a database. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @param {string} locationName The location of the database * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} longTermRetentionServerName * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionDatabaseName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -12963,7 +15629,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12971,56 +15637,57 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync groups under a hub database. + * Lists the long term retention backups for a given location. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {object} [options] Optional Parameters. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Lists the long term retention backups for a given location. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {object} [options] Optional Parameters. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13032,7 +15699,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13040,60 +15707,61 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. + * Lists the long term retention backups for a given server. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} [options] Optional Parameters. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * Lists the long term retention backups for a given server. * - * @param {string} 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 {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} [options] Optional Parameters. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13105,7 +15773,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13113,54 +15781,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * Deletes a long term retention backup. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} locationName The location of the database * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} longTermRetentionDatabaseName * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13169,49 +15812,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * Deletes a long term retention backup. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} locationName The location of the database * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} longTermRetentionDatabaseName * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13225,7 +15841,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13233,31 +15849,22 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync group. - * - * @param {string} 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 {string} serverName The name of the server. + * Lists all long term retention backups for a database. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13266,25 +15873,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all long term retention backups for a database. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13298,7 +15897,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13306,54 +15905,24 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * Lists the long term retention backups for a given location. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13362,49 +15931,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. + * Lists the long term retention backups for a given location. * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. - * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13418,7 +15955,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13426,20 +15963,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync database ids. + * Lists the long term retention backups for a given server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13451,14 +15989,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Lists the long term retention backups for a given server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13475,7 +16013,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13483,24 +16021,38 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; - listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * BackupLongTermRetentionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface BackupLongTermRetentionPolicies { /** - * Gets a collection of hub database schemas. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13509,17 +16061,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13533,7 +16090,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13541,24 +16098,43 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync group logs. + * Sets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13567,17 +16143,36 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Sets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13591,7 +16186,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13599,24 +16194,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLogsNext(nextPageLink: string, callback: ServiceCallback): void; - listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync groups under a hub database. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13625,17 +16225,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13649,7 +16254,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13657,29 +16262,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncMembers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncMembers { + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member. + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13687,13 +16284,21 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} databaseName The name of the database. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters The long term retention policy info. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13702,28 +16307,36 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member. + * Sets a database's long term retention policy. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13737,7 +16350,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13745,20 +16358,30 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerAutomaticTuningOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerAutomaticTuningOperations { /** - * Creates or updates a sync member. + * Retrieves server automatic tuning options. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13766,41 +16389,6 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. - * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13808,14 +16396,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * Retrieves server automatic tuning options. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13823,41 +16411,6 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. - * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13870,7 +16423,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13878,20 +16431,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync member. + * Update automatic tuning options on server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13899,13 +16452,12 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} syncMemberName The name of the sync member. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -13914,14 +16466,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * Update automatic tuning options on server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13929,13 +16481,12 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} syncMemberName The name of the sync member. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -13949,7 +16500,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13957,60 +16508,38 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerDnsAliases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerDnsAliases { /** - * Updates an existing sync member. + * Gets a server DNS alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14019,55 +16548,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * Gets a server DNS alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14081,7 +16578,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14089,31 +16586,29 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync members in the given sync group. + * Creates a server dns alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14122,25 +16617,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Creates a server dns alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14154,7 +16647,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14162,34 +16655,29 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMemberListResult} for more information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member database schema. + * Deletes the server DNS alias with the given name. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14198,28 +16686,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Deletes the server DNS alias with the given name. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14233,7 +16716,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14241,35 +16724,26 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Gets a list of server DNS aliases for a server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * * @param {object} [options] Optional Parameters. * @@ -14278,28 +16752,21 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Gets a list of server DNS aliases for a server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * * @param {object} [options] Optional Parameters. * @@ -14313,7 +16780,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14321,60 +16788,35 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync member. + * Acquires server DNS alias from another server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {object} parameters * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14383,55 +16825,28 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * Acquires server DNS alias from another server. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {object} parameters * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14445,7 +16860,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14453,34 +16868,28 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync member. + * Creates a server dns alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14489,28 +16898,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * Creates a server dns alias. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14524,7 +16928,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14532,60 +16936,29 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing sync member. + * Deletes the server DNS alias with the given name. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14594,55 +16967,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * Deletes the server DNS alias with the given name. * * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14656,7 +16997,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14664,34 +17005,33 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Acquires server DNS alias from another server. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14704,24 +17044,24 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Acquires server DNS alias from another server. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14749,13 +17089,13 @@ export interface SyncMembers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync members in the given sync group. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -14767,14 +17107,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -14791,7 +17131,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14799,23 +17139,38 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMemberListResult} for more information. + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySyncGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySyncGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listBySyncGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RestorePoints + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface RestorePoints { /** - * Gets a sync member database schema. + * Gets a list of database restore points. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14824,17 +17179,22 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Gets a list of database restore points. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14848,7 +17208,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {RestorePointListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14856,30 +17216,21 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more + * {RestorePointListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePointListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworkRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface VirtualNetworkRules { + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a virtual network rule. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14887,7 +17238,13 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14896,14 +17253,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual network rule. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14911,7 +17268,13 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14925,7 +17288,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14933,20 +17296,20 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an existing virtual network rule. + * Gets a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14954,16 +17317,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14972,14 +17328,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Gets a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14987,16 +17343,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15010,7 +17359,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15018,20 +17367,20 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Deletes a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15039,7 +17388,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15052,10 +17403,10 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Deletes a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15063,7 +17414,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15091,13 +17444,13 @@ export interface VirtualNetworkRules { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15105,6 +17458,14 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15112,14 +17473,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15127,6 +17488,14 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15139,7 +17508,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15147,21 +17516,29 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} for more - * information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseOperations { /** - * Creates or updates an existing virtual network rule. + * Cancels the asynchronous operation on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15169,16 +17546,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -15187,14 +17557,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Cancels the asynchronous operation on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15202,16 +17572,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -15225,7 +17588,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15233,20 +17596,19 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15254,7 +17616,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15263,14 +17625,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15278,7 +17640,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15292,7 +17654,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15300,19 +17662,21 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseOperationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Gets a list of operations performed on the database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15324,14 +17688,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Gets a list of operations performed on the database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15348,7 +17712,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15356,30 +17720,30 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} for more + * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DatabaseOperations + * ElasticPoolOperations * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseOperations { +export interface ElasticPoolOperations { /** - * Cancels the asynchronous operation on the database. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15387,7 +17751,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {uuid} operationId The operation identifier. * @@ -15402,10 +17766,10 @@ export interface DatabaseOperations { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15413,7 +17777,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {uuid} operationId The operation identifier. * @@ -15443,13 +17807,13 @@ export interface DatabaseOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15457,7 +17821,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15466,14 +17830,14 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15481,7 +17845,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15495,7 +17859,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15503,21 +17867,21 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15529,14 +17893,14 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15553,7 +17917,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15561,15 +17925,15 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPoolNext(nextPageLink: string, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 604e407dcc..ed7f47bc24 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -14,25 +14,22 @@ 'use strict'; -exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); -exports.BackupLongTermRetentionVaults = require('./backupLongTermRetentionVaults'); -exports.RestorePoints = require('./restorePoints'); exports.RecoverableDatabases = require('./recoverableDatabases'); exports.RestorableDroppedDatabases = require('./restorableDroppedDatabases'); exports.Capabilities = require('./capabilities'); +exports.Servers = require('./servers'); exports.ServerConnectionPolicies = require('./serverConnectionPolicies'); +exports.Databases = require('./databases'); exports.DatabaseThreatDetectionPolicies = require('./databaseThreatDetectionPolicies'); exports.DataMaskingPolicies = require('./dataMaskingPolicies'); exports.DataMaskingRules = require('./dataMaskingRules'); +exports.ElasticPools = require('./elasticPools'); exports.FirewallRules = require('./firewallRules'); exports.GeoBackupPolicies = require('./geoBackupPolicies'); -exports.Databases = require('./databases'); -exports.ElasticPools = require('./elasticPools'); exports.ReplicationLinks = require('./replicationLinks'); exports.ServerAzureADAdministrators = require('./serverAzureADAdministrators'); exports.ServerCommunicationLinks = require('./serverCommunicationLinks'); exports.ServiceObjectives = require('./serviceObjectives'); -exports.Servers = require('./servers'); exports.ElasticPoolActivities = require('./elasticPoolActivities'); exports.ElasticPoolDatabaseActivities = require('./elasticPoolDatabaseActivities'); exports.RecommendedElasticPools = require('./recommendedElasticPools'); @@ -42,6 +39,7 @@ exports.TransparentDataEncryptionActivities = require('./transparentDataEncrypti exports.ServerUsages = require('./serverUsages'); exports.DatabaseUsages = require('./databaseUsages'); exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies'); +exports.DatabaseAutomaticTuningOperations = require('./databaseAutomaticTuningOperations'); exports.EncryptionProtectors = require('./encryptionProtectors'); exports.FailoverGroups = require('./failoverGroups'); exports.Operations = require('./operations'); @@ -49,5 +47,12 @@ exports.ServerKeys = require('./serverKeys'); exports.SyncAgents = require('./syncAgents'); exports.SyncGroups = require('./syncGroups'); exports.SyncMembers = require('./syncMembers'); +exports.SubscriptionUsages = require('./subscriptionUsages'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); +exports.LongTermRetentionBackups = require('./longTermRetentionBackups'); +exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); +exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); +exports.ServerDnsAliases = require('./serverDnsAliases'); +exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); +exports.ElasticPoolOperations = require('./elasticPoolOperations'); diff --git a/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js b/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js new file mode 100644 index 0000000000..39ad67fada --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js @@ -0,0 +1,2116 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { + throw new Error('backupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocation(locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServer(locationName, longTermRetentionServerName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { + throw new Error('backupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabaseNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocationNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a LongTermRetentionBackups. */ +class LongTermRetentionBackups { + /** + * Create a LongTermRetentionBackups. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByDatabase = _listByDatabase; + this._listByLocation = _listByLocation; + this._listByServer = _listByServer; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByDatabaseNext = _listByDatabaseNext; + this._listByLocationNext = _listByLocationNext; + this._listByServerNext = _listByServerNext; + } + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(locationName, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(locationName, longTermRetentionServerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(locationName, longTermRetentionServerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(locationName, longTermRetentionServerName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(locationName, longTermRetentionServerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(locationName, longTermRetentionServerName, options, optionalCallback); + } + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabaseNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabaseNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServerNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LongTermRetentionBackups; diff --git a/lib/services/sqlManagement2/lib/operations/replicationLinks.js b/lib/services/sqlManagement2/lib/operations/replicationLinks.js index c728ae73a3..c0895596f9 100644 --- a/lib/services/sqlManagement2/lib/operations/replicationLinks.js +++ b/lib/services/sqlManagement2/lib/operations/replicationLinks.js @@ -713,7 +713,7 @@ function _beginFailover(resourceGroupName, serverName, databaseName, linkId, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -854,7 +854,7 @@ function _beginFailoverAllowDataLoss(resourceGroupName, serverName, databaseName return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/restorePoints.js b/lib/services/sqlManagement2/lib/operations/restorePoints.js index 894ccdc7cf..7c1928a3fe 100644 --- a/lib/services/sqlManagement2/lib/operations/restorePoints.js +++ b/lib/services/sqlManagement2/lib/operations/restorePoints.js @@ -23,8 +23,7 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get available - * restore points. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -55,12 +54,9 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -70,6 +66,9 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -80,10 +79,10 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -167,111 +166,1095 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c }); } -/** Class representing a RestorePoints. */ -class RestorePoints { - /** - * Create a RestorePoints. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDatabase = _listByDatabase; + +/** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - /** - * Gets a list of database restore points. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); }); + }); +} + +/** + * Gets a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, databaseName, restorePointName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (restorePointName === null || restorePointName === undefined || typeof restorePointName.valueOf() !== 'string') { + throw new Error('restorePointName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * Gets a list of database restore points. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RestorePointListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePointListResult} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{restorePointName}', encodeURIComponent(restorePointName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (restorePointName === null || restorePointName === undefined || typeof restorePointName.valueOf() !== 'string') { + throw new Error('restorePointName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{restorePointName}', encodeURIComponent(restorePointName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CreateDatabaseRestorePointDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a RestorePoints. */ +class RestorePoints { + /** + * Create a RestorePoints. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByDatabase = _listByDatabase; + this._create = _create; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._beginCreate = _beginCreate; + } + + /** + * Gets a list of database restore points. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of database restore points. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePointListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePointListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Gets a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, restorePointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback); + } + } + + /** + * Deletes a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, restorePointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a restore point. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback); + } + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js b/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js new file mode 100644 index 0000000000..80b3344111 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js @@ -0,0 +1,539 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves server automatic tuning options. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update automatic tuning options on server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServerAutomaticTuning']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServerAutomaticTuningOperations. */ +class ServerAutomaticTuningOperations { + /** + * Create a ServerAutomaticTuningOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._update = _update; + } + + /** + * Retrieves server automatic tuning options. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves server automatic tuning options. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Update automatic tuning options on server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update automatic tuning options on server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + +} + +module.exports = ServerAutomaticTuningOperations; diff --git a/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js b/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js index bf172a7edf..10775ded7e 100644 --- a/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js +++ b/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js @@ -793,7 +793,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -822,7 +822,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 202) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -839,7 +839,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { } } // Deserialize Response - if (statusCode === 204) { + if (statusCode === 202) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -856,7 +856,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 204) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js b/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js new file mode 100644 index 0000000000..9ca87bf521 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js @@ -0,0 +1,2014 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a server DNS alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a list of server DNS aliases for a server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServer(resourceGroupName, serverName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAliasListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServerDnsAliasAcquisition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAliasListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServerDnsAliases. */ +class ServerDnsAliases { + /** + * Create a ServerDnsAliases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByServer = _listByServer; + this._acquire = _acquire; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginAcquire = _beginAcquire; + this._listByServerNext = _listByServerNext; + } + + /** + * Gets a server DNS alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a server DNS alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + acquireWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback); + } + } + + /** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a server dns alias. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginAcquireWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} 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 {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServerNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ServerDnsAliases; diff --git a/lib/services/sqlManagement2/lib/operations/serverKeys.js b/lib/services/sqlManagement2/lib/operations/serverKeys.js index 2562ae3491..54772dd044 100644 --- a/lib/services/sqlManagement2/lib/operations/serverKeys.js +++ b/lib/services/sqlManagement2/lib/operations/serverKeys.js @@ -617,7 +617,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, keyName, parameters return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/servers.js b/lib/services/sqlManagement2/lib/operations/servers.js index 7950917757..7d1ed28aff 100644 --- a/lib/services/sqlManagement2/lib/operations/servers.js +++ b/lib/services/sqlManagement2/lib/operations/servers.js @@ -980,7 +980,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, parameters, options return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js b/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js new file mode 100644 index 0000000000..829b0b17e0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js @@ -0,0 +1,701 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocation(locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(locationName, usageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (usageName === null || usageName === undefined || typeof usageName.valueOf() !== 'string') { + throw new Error('usageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{usageName}', encodeURIComponent(usageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsage']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocationNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a SubscriptionUsages. */ +class SubscriptionUsages { + /** + * Create a SubscriptionUsages. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByLocation = _listByLocation; + this._get = _get; + this._listByLocationNext = _listByLocationNext; + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(locationName, options, optionalCallback); + } + } + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(locationName, usageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, usageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsage} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName, usageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(locationName, usageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, usageName, options, optionalCallback); + } + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = SubscriptionUsages; diff --git a/lib/services/sqlManagement2/lib/operations/syncAgents.js b/lib/services/sqlManagement2/lib/operations/syncAgents.js index 825cd5596d..2bf8c1b449 100644 --- a/lib/services/sqlManagement2/lib/operations/syncAgents.js +++ b/lib/services/sqlManagement2/lib/operations/syncAgents.js @@ -898,7 +898,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, syncAgentName, para return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/syncGroups.js b/lib/services/sqlManagement2/lib/operations/syncGroups.js index c5c13b03aa..3f3931980e 100644 --- a/lib/services/sqlManagement2/lib/operations/syncGroups.js +++ b/lib/services/sqlManagement2/lib/operations/syncGroups.js @@ -1737,7 +1737,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncG return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/syncMembers.js b/lib/services/sqlManagement2/lib/operations/syncMembers.js index b15b34186e..bdafcb363a 100644 --- a/lib/services/sqlManagement2/lib/operations/syncMembers.js +++ b/lib/services/sqlManagement2/lib/operations/syncMembers.js @@ -1038,7 +1038,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncG return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js b/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js index c6662e454e..8fc3de45e4 100644 --- a/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js +++ b/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js @@ -596,7 +596,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, virtualNetworkRuleN return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index e61fdb8712..a37373a060 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class SqlManagementClient extends AzureServiceClient { +export default class SqlManagementClient extends AzureServiceClient { /** * Initializes a new instance of the SqlManagementClient class. * @constructor @@ -53,25 +54,22 @@ declare class SqlManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups - backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; - backupLongTermRetentionVaults: operations.BackupLongTermRetentionVaults; - restorePoints: operations.RestorePoints; recoverableDatabases: operations.RecoverableDatabases; restorableDroppedDatabases: operations.RestorableDroppedDatabases; capabilities: operations.Capabilities; + servers: operations.Servers; serverConnectionPolicies: operations.ServerConnectionPolicies; + databases: operations.Databases; databaseThreatDetectionPolicies: operations.DatabaseThreatDetectionPolicies; dataMaskingPolicies: operations.DataMaskingPolicies; dataMaskingRules: operations.DataMaskingRules; + elasticPools: operations.ElasticPools; firewallRules: operations.FirewallRules; geoBackupPolicies: operations.GeoBackupPolicies; - databases: operations.Databases; - elasticPools: operations.ElasticPools; replicationLinks: operations.ReplicationLinks; serverAzureADAdministrators: operations.ServerAzureADAdministrators; serverCommunicationLinks: operations.ServerCommunicationLinks; serviceObjectives: operations.ServiceObjectives; - servers: operations.Servers; elasticPoolActivities: operations.ElasticPoolActivities; elasticPoolDatabaseActivities: operations.ElasticPoolDatabaseActivities; recommendedElasticPools: operations.RecommendedElasticPools; @@ -81,6 +79,7 @@ declare class SqlManagementClient extends AzureServiceClient { serverUsages: operations.ServerUsages; databaseUsages: operations.DatabaseUsages; databaseBlobAuditingPolicies: operations.DatabaseBlobAuditingPolicies; + databaseAutomaticTuningOperations: operations.DatabaseAutomaticTuningOperations; encryptionProtectors: operations.EncryptionProtectors; failoverGroups: operations.FailoverGroups; operations: operations.Operations; @@ -88,8 +87,15 @@ declare class SqlManagementClient extends AzureServiceClient { syncAgents: operations.SyncAgents; syncGroups: operations.SyncGroups; syncMembers: operations.SyncMembers; + subscriptionUsages: operations.SubscriptionUsages; virtualNetworkRules: operations.VirtualNetworkRules; + longTermRetentionBackups: operations.LongTermRetentionBackups; + backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; + serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; + serverDnsAliases: operations.ServerDnsAliases; + restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; + elasticPoolOperations: operations.ElasticPoolOperations; } -export = SqlManagementClient; +export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index fcbe0c0d25..cd18ce1370 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -71,25 +71,22 @@ class SqlManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } - this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); - this.backupLongTermRetentionVaults = new operations.BackupLongTermRetentionVaults(this); - this.restorePoints = new operations.RestorePoints(this); this.recoverableDatabases = new operations.RecoverableDatabases(this); this.restorableDroppedDatabases = new operations.RestorableDroppedDatabases(this); this.capabilities = new operations.Capabilities(this); + this.servers = new operations.Servers(this); this.serverConnectionPolicies = new operations.ServerConnectionPolicies(this); + this.databases = new operations.Databases(this); this.databaseThreatDetectionPolicies = new operations.DatabaseThreatDetectionPolicies(this); this.dataMaskingPolicies = new operations.DataMaskingPolicies(this); this.dataMaskingRules = new operations.DataMaskingRules(this); + this.elasticPools = new operations.ElasticPools(this); this.firewallRules = new operations.FirewallRules(this); this.geoBackupPolicies = new operations.GeoBackupPolicies(this); - this.databases = new operations.Databases(this); - this.elasticPools = new operations.ElasticPools(this); this.replicationLinks = new operations.ReplicationLinks(this); this.serverAzureADAdministrators = new operations.ServerAzureADAdministrators(this); this.serverCommunicationLinks = new operations.ServerCommunicationLinks(this); this.serviceObjectives = new operations.ServiceObjectives(this); - this.servers = new operations.Servers(this); this.elasticPoolActivities = new operations.ElasticPoolActivities(this); this.elasticPoolDatabaseActivities = new operations.ElasticPoolDatabaseActivities(this); this.recommendedElasticPools = new operations.RecommendedElasticPools(this); @@ -99,6 +96,7 @@ class SqlManagementClient extends ServiceClient { this.serverUsages = new operations.ServerUsages(this); this.databaseUsages = new operations.DatabaseUsages(this); this.databaseBlobAuditingPolicies = new operations.DatabaseBlobAuditingPolicies(this); + this.databaseAutomaticTuningOperations = new operations.DatabaseAutomaticTuningOperations(this); this.encryptionProtectors = new operations.EncryptionProtectors(this); this.failoverGroups = new operations.FailoverGroups(this); this.operations = new operations.Operations(this); @@ -106,8 +104,15 @@ class SqlManagementClient extends ServiceClient { this.syncAgents = new operations.SyncAgents(this); this.syncGroups = new operations.SyncGroups(this); this.syncMembers = new operations.SyncMembers(this); + this.subscriptionUsages = new operations.SubscriptionUsages(this); this.virtualNetworkRules = new operations.VirtualNetworkRules(this); + this.longTermRetentionBackups = new operations.LongTermRetentionBackups(this); + this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); + this.serverAutomaticTuningOperations = new operations.ServerAutomaticTuningOperations(this); + this.serverDnsAliases = new operations.ServerDnsAliases(this); + this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); + this.elasticPoolOperations = new operations.ElasticPoolOperations(this); this.models = models; msRest.addSerializationMixin(this); } @@ -115,3 +120,6 @@ class SqlManagementClient extends ServiceClient { } module.exports = SqlManagementClient; +module.exports['default'] = SqlManagementClient; +module.exports.SqlManagementClient = SqlManagementClient; +module.exports.SqlManagementModels = models; From 1b7bc18285ce0142ee00df1e31991fa9de1cd8f5 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 28 Mar 2018 11:32:11 -0700 Subject: [PATCH 2/2] Update sql major version and regenerate --- codegen_mappings.json | 2 + lib/services/sqlManagement2/LICENSE.txt | 4 +- lib/services/sqlManagement2/README.md | 51 +- .../sqlManagement2/lib/models/database.js | 383 +- .../lib/models/databaseListResult.js | 14 +- .../lib/models/databaseUpdate.js | 398 +- .../lib/models/editionCapability.js | 35 +- .../sqlManagement2/lib/models/elasticPool.js | 91 +- .../models/elasticPoolEditionCapability.js | 45 +- .../lib/models/elasticPoolListResult.js | 14 +- ...erDatabaseMaxPerformanceLevelCapability.js | 103 + ...erDatabaseMinPerformanceLevelCapability.js | 83 + .../models/elasticPoolPerDatabaseSettings.js | 62 + .../elasticPoolPerformanceLevelCapability.js | 193 + .../lib/models/elasticPoolUpdate.js | 137 +- .../sqlManagement2/lib/models/index.d.ts | 4084 ++++++----- .../sqlManagement2/lib/models/index.js | 70 +- .../lib/models/licenseTypeCapability.js | 73 + .../lib/models/locationCapabilities.js | 49 +- .../lib/models/logSizeCapability.js | 64 + .../managedInstanceEditionCapability.js | 92 + .../models/managedInstanceFamilyCapability.js | 151 + .../models/managedInstanceVcoresCapability.js | 82 + .../managedInstanceVersionCapability.js | 93 + .../lib/models/maxSizeCapability.js | 20 +- .../lib/models/maxSizeRangeCapability.js | 127 + .../lib/models/performanceLevelCapability.js | 63 + .../lib/models/recommendedElasticPool.js | 4 +- .../lib/models/serverVersionCapability.js | 33 +- .../lib/models/serviceObjectiveCapability.js | 101 +- lib/services/sqlManagement2/lib/models/sku.js | 87 + .../lib/operations/capabilities.js | 61 +- .../lib/operations/databases.js | 6439 ++++++++--------- .../lib/operations/elasticPools.js | 2258 +++--- .../sqlManagement2/lib/operations/index.d.ts | 5182 ++++++------- .../sqlManagement2/lib/operations/index.js | 8 +- .../lib/sqlManagementClient.d.ts | 8 +- .../sqlManagement2/lib/sqlManagementClient.js | 8 +- lib/services/sqlManagement2/package.json | 33 +- 39 files changed, 11404 insertions(+), 9401 deletions(-) create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMaxPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMinPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseSettings.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/licenseTypeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/logSizeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/performanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/sku.js diff --git a/codegen_mappings.json b/codegen_mappings.json index b15f7af802..b681dad419 100644 --- a/codegen_mappings.json +++ b/codegen_mappings.json @@ -668,6 +668,8 @@ "sql": { "resource-manager": { "packageName": "azure-arm-sql", + "packageVersion": "3.0.0", + "generateReadmeMd": true, "dir": "sqlManagement2", "source": "sql/resource-manager" } diff --git a/lib/services/sqlManagement2/LICENSE.txt b/lib/services/sqlManagement2/LICENSE.txt index 0313a903d7..a70e8cf660 100644 --- a/lib/services/sqlManagement2/LICENSE.txt +++ b/lib/services/sqlManagement2/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Microsoft +Copyright (c) 2018 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/lib/services/sqlManagement2/README.md b/lib/services/sqlManagement2/README.md index c0d7e0e514..e2cb47350b 100644 --- a/lib/services/sqlManagement2/README.md +++ b/lib/services/sqlManagement2/README.md @@ -1,7 +1,9 @@ -# Microsoft Azure SDK for Node.js - SQLManagement +# Microsoft Azure SDK for Node.js - SqlManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features -This project provides a Node.js package that makes it easy to manage Microsoft Azure SQL. -## Minimum node.js version >= 6.x.x ## How to Install @@ -9,29 +11,28 @@ This project provides a Node.js package that makes it easy to manage Microsoft A npm install azure-arm-sql ``` -## How to Use - -### Authentication, client creation and listing servers as an example - - ```javascript - const msRestAzure = require('ms-rest-azure'); - const SQLManagement = require("azure-arm-sql"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin().then((credentials) => { - let client = new SQLManagement(credentials, 'your-subscription-id'); - return client.servers.list(); - }).then((servers) => { - console.log('List of servers:'); - console.dir(servers, {depth: null, colors: true}); +## How to use + +### Authentication, client creation and get recoverableDatabases as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const SqlManagementClient = require("azure-arm-sql"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new SqlManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const serverName = "testserverName"; + const databaseName = "testdatabaseName"; + return client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { - console.log('An error ocurred'); - console.dir(err, {depth: null, colors: true}); - }); -``` + console.log('An error ocurred:'); + console.dir(err, {depth: null, colors: true}); +}); ## Related projects -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) \ No newline at end of file +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/sqlManagement2/lib/models/database.js b/lib/services/sqlManagement2/lib/models/database.js index ea7b30a367..120ae1703a 100644 --- a/lib/services/sqlManagement2/lib/models/database.js +++ b/lib/services/sqlManagement2/lib/models/database.js @@ -13,26 +13,25 @@ const models = require('./index'); /** - * Represents a database. + * A database resource. * * @extends models['TrackedResource'] */ class Database extends models['TrackedResource'] { /** * Create a Database. - * @member {string} [kind] Kind of database. This is metadata used for the + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of database. This is metadata used for the * Azure portal experience. - * @member {string} [collation] The collation of the database. If createMode - * is not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level - * objective that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). + * @member {string} [managedBy] Resource that manages the database. * @member {string} [createMode] Specifies the mode of database creation. * * Default: regular database creation. @@ -41,9 +40,9 @@ class Database extends models['TrackedResource'] { * sourceDatabaseId must be specified as the resource ID of the source * database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the @@ -65,112 +64,76 @@ class Database extends models['TrackedResource'] { * long term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse - * edition. Possible values include: 'Copy', 'Default', - * 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', - * 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource - * id when it existed (as opposed to its current restorable dropped database - * id), then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If - * createMode is NonReadableSecondary or OnlineSecondary, this value is - * ignored. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions -l westus --query [].name`. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is - * in the process of being applied to the database. Once successfully - * updated, it will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', - * 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', - * 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', - * 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', - * 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', - * 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', - * 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', - * 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', - * 'DS2000', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'System', 'System0', - * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', - * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', - * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', - * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', - * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', - * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the - * database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * @member {string} [collation] The collation of the database. + * @member {number} [maxSizeBytes] The max size of the database expressed in + * bytes. + * @member {string} [sampleName] The name of the sample schema to apply when + * creating this database. Possible values include: 'AdventureWorksLT', + * 'WideWorldImportersStd', 'WideWorldImportersFull' + * @member {string} [elasticPoolId] The resource identifier of the elastic + * pool containing this database. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [status] 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' + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {string} [currentServiceObjectiveName] The current service level + * objective name of the database. + * @member {string} [requestedServiceObjectiveName] The requested service + * level objective name of the database. * @member {string} [defaultSecondaryLocation] The default secondary region * for this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors - * for this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data - * encryption info for this database. - * @member {array} [recommendedIndex] The recommended indices for this + * @member {string} [failoverGroupId] Failover Group resource identifier that + * this database belongs to. + * @member {date} [restorePointInTime] Specifies the point in time (ISO8601 + * format) of the source database that will be restored to create the new + * database. + * @member {date} [sourceDatabaseDeletionDate] Specifies the time that the + * database was deleted. + * @member {string} [recoveryServicesRecoveryPointId] The resource identifier + * of the recovery point associated with create operation of this database. + * @member {string} [longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * @member {string} [recoverableDatabaseId] The resource identifier of the + * recoverable database associated with create operation of this database. + * @member {string} [restorableDroppedDatabaseId] The resource identifier of + * the restorable dropped database associated with create operation of this * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are - * allowed to this database or not. Not supported for DataWarehouse edition. - * Possible values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this - * value is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * @member {boolean} [zoneRedundant] Whether or not this database is zone * redundant, which means the replicas of this database will be spread across * multiple availability zones. + * @member {string} [licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {number} [maxLogSizeBytes] The max log size for this database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [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' + * @member {object} [currentSku] The name and tier of the SKU. + * @member {string} [currentSku.name] The name of the SKU, typically, a + * letter + Number code, e.g. P3. + * @member {string} [currentSku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * @member {string} [currentSku.size] Size of the particular SKU + * @member {string} [currentSku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * @member {number} [currentSku.capacity] Capacity of the particular SKU. */ constructor() { super(); @@ -235,6 +198,14 @@ class Database extends models['TrackedResource'] { name: 'String' } }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, kind: { required: false, readOnly: true, @@ -243,223 +214,205 @@ class Database extends models['TrackedResource'] { name: 'String' } }, - collation: { + managedBy: { required: false, - serializedName: 'properties.collation', + readOnly: true, + serializedName: 'managedBy', type: { name: 'String' } }, - creationDate: { + createMode: { required: false, - readOnly: true, - serializedName: 'properties.creationDate', + serializedName: 'properties.createMode', type: { - name: 'DateTime' + name: 'String' } }, - containmentState: { + collation: { required: false, - readOnly: true, - serializedName: 'properties.containmentState', + serializedName: 'properties.collation', + type: { + name: 'String' + } + }, + maxSizeBytes: { + required: false, + serializedName: 'properties.maxSizeBytes', type: { name: 'Number' } }, - currentServiceObjectiveId: { + sampleName: { required: false, - readOnly: true, - serializedName: 'properties.currentServiceObjectiveId', + serializedName: 'properties.sampleName', type: { name: 'String' } }, - databaseId: { + elasticPoolId: { required: false, - readOnly: true, - serializedName: 'properties.databaseId', + serializedName: 'properties.elasticPoolId', type: { name: 'String' } }, - earliestRestoreDate: { + sourceDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.earliestRestoreDate', + serializedName: 'properties.sourceDatabaseId', type: { - name: 'DateTime' + name: 'String' } }, - createMode: { + status: { required: false, - serializedName: 'properties.createMode', + readOnly: true, + serializedName: 'properties.status', type: { name: 'String' } }, - sourceDatabaseId: { + databaseId: { required: false, - serializedName: 'properties.sourceDatabaseId', + readOnly: true, + serializedName: 'properties.databaseId', type: { name: 'String' } }, - sourceDatabaseDeletionDate: { + creationDate: { required: false, - serializedName: 'properties.sourceDatabaseDeletionDate', + readOnly: true, + serializedName: 'properties.creationDate', type: { name: 'DateTime' } }, - restorePointInTime: { + currentServiceObjectiveName: { required: false, - serializedName: 'properties.restorePointInTime', + readOnly: true, + serializedName: 'properties.currentServiceObjectiveName', type: { - name: 'DateTime' + name: 'String' } }, - recoveryServicesRecoveryPointResourceId: { + requestedServiceObjectiveName: { required: false, - serializedName: 'properties.recoveryServicesRecoveryPointResourceId', + readOnly: true, + serializedName: 'properties.requestedServiceObjectiveName', type: { name: 'String' } }, - edition: { + defaultSecondaryLocation: { required: false, - serializedName: 'properties.edition', + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', type: { name: 'String' } }, - maxSizeBytes: { + failoverGroupId: { required: false, - serializedName: 'properties.maxSizeBytes', + readOnly: true, + serializedName: 'properties.failoverGroupId', type: { name: 'String' } }, - requestedServiceObjectiveId: { + restorePointInTime: { required: false, - serializedName: 'properties.requestedServiceObjectiveId', + serializedName: 'properties.restorePointInTime', type: { - name: 'String' + name: 'DateTime' } }, - requestedServiceObjectiveName: { + sourceDatabaseDeletionDate: { required: false, - serializedName: 'properties.requestedServiceObjectiveName', + serializedName: 'properties.sourceDatabaseDeletionDate', type: { - name: 'String' + name: 'DateTime' } }, - serviceLevelObjective: { + recoveryServicesRecoveryPointId: { required: false, - readOnly: true, - serializedName: 'properties.serviceLevelObjective', + serializedName: 'properties.recoveryServicesRecoveryPointId', type: { name: 'String' } }, - status: { + longTermRetentionBackupResourceId: { required: false, - readOnly: true, - serializedName: 'properties.status', + serializedName: 'properties.longTermRetentionBackupResourceId', type: { name: 'String' } }, - elasticPoolName: { + recoverableDatabaseId: { required: false, - serializedName: 'properties.elasticPoolName', + serializedName: 'properties.recoverableDatabaseId', type: { name: 'String' } }, - defaultSecondaryLocation: { + restorableDroppedDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.defaultSecondaryLocation', + serializedName: 'properties.restorableDroppedDatabaseId', type: { name: 'String' } }, - serviceTierAdvisors: { + catalogCollation: { required: false, - readOnly: true, - serializedName: 'properties.serviceTierAdvisors', + serializedName: 'properties.catalogCollation', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceTierAdvisorElementType', - type: { - name: 'Composite', - className: 'ServiceTierAdvisor' - } - } + name: 'String' } }, - transparentDataEncryption: { + zoneRedundant: { required: false, - readOnly: true, - serializedName: 'properties.transparentDataEncryption', + serializedName: 'properties.zoneRedundant', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TransparentDataEncryptionElementType', - type: { - name: 'Composite', - className: 'TransparentDataEncryption' - } - } + name: 'Boolean' } }, - recommendedIndex: { + licenseType: { required: false, - readOnly: true, - serializedName: 'properties.recommendedIndex', + serializedName: 'properties.licenseType', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RecommendedIndexElementType', - type: { - name: 'Composite', - className: 'RecommendedIndex' - } - } + name: 'String' } }, - failoverGroupId: { + maxLogSizeBytes: { required: false, readOnly: true, - serializedName: 'properties.failoverGroupId', + serializedName: 'properties.maxLogSizeBytes', type: { - name: 'String' + name: 'Number' } }, - readScale: { + earliestRestoreDate: { required: false, - serializedName: 'properties.readScale', + readOnly: true, + serializedName: 'properties.earliestRestoreDate', type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] + name: 'DateTime' } }, - sampleName: { + readScale: { required: false, - serializedName: 'properties.sampleName', + serializedName: 'properties.readScale', type: { name: 'String' } }, - zoneRedundant: { + currentSku: { required: false, - serializedName: 'properties.zoneRedundant', + readOnly: true, + serializedName: 'properties.currentSku', type: { - name: 'Boolean' + name: 'Composite', + className: 'Sku' } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseListResult.js b/lib/services/sqlManagement2/lib/models/databaseListResult.js index 8d8f143e1f..7e34d7100c 100644 --- a/lib/services/sqlManagement2/lib/models/databaseListResult.js +++ b/lib/services/sqlManagement2/lib/models/databaseListResult.js @@ -11,11 +11,12 @@ 'use strict'; /** - * Represents the response to a list database request. + * A list of databases. */ class DatabaseListResult extends Array { /** * Create a DatabaseListResult. + * @member {string} [nextLink] Link to retrieve next page of results. */ constructor() { super(); @@ -36,7 +37,8 @@ class DatabaseListResult extends Array { className: 'DatabaseListResult', modelProperties: { value: { - required: true, + required: false, + readOnly: true, serializedName: '', type: { name: 'Sequence', @@ -49,6 +51,14 @@ class DatabaseListResult extends Array { } } } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseUpdate.js b/lib/services/sqlManagement2/lib/models/databaseUpdate.js index e0d2776b6b..9cd896d3e6 100644 --- a/lib/services/sqlManagement2/lib/models/databaseUpdate.js +++ b/lib/services/sqlManagement2/lib/models/databaseUpdate.js @@ -13,25 +13,21 @@ const models = require('./index'); /** - * Represents a database update. + * A database resource. * - * @extends models['Resource'] */ -class DatabaseUpdate extends models['Resource'] { +class DatabaseUpdate { /** * Create a DatabaseUpdate. - * @member {object} [tags] Resource tags. - * @member {string} [collation] The collation of the database. If createMode - * is not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level - * objective that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. * @member {string} [createMode] Specifies the mode of database creation. * * Default: regular database creation. @@ -40,9 +36,9 @@ class DatabaseUpdate extends models['Resource'] { * sourceDatabaseId must be specified as the resource ID of the source * database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the @@ -64,115 +60,79 @@ class DatabaseUpdate extends models['Resource'] { * long term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse - * edition. Possible values include: 'Copy', 'Default', - * 'NonReadableSecondary', 'OnlineSecondary', 'PointInTimeRestore', - * 'Recovery', 'Restore', 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource - * id when it existed (as opposed to its current restorable dropped database - * id), then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If - * createMode is NonReadableSecondary or OnlineSecondary, this value is - * ignored. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions -l westus --query [].name`. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is - * in the process of being applied to the database. Once successfully - * updated, it will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the - * Azure CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', - * 'System2L', 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', - * 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', - * 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', - * 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', - * 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', - * 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', - * 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', - * 'DS2000', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'System', 'System0', - * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', - * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', - * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', - * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', - * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', - * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the - * database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * @member {string} [collation] The collation of the database. + * @member {number} [maxSizeBytes] The max size of the database expressed in + * bytes. + * @member {string} [sampleName] The name of the sample schema to apply when + * creating this database. Possible values include: 'AdventureWorksLT', + * 'WideWorldImportersStd', 'WideWorldImportersFull' + * @member {string} [elasticPoolId] The resource identifier of the elastic + * pool containing this database. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [status] 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' + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {string} [currentServiceObjectiveName] The current service level + * objective name of the database. + * @member {string} [requestedServiceObjectiveName] The requested service + * level objective name of the database. * @member {string} [defaultSecondaryLocation] The default secondary region * for this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors - * for this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data - * encryption info for this database. - * @member {array} [recommendedIndex] The recommended indices for this + * @member {string} [failoverGroupId] Failover Group resource identifier that + * this database belongs to. + * @member {date} [restorePointInTime] Specifies the point in time (ISO8601 + * format) of the source database that will be restored to create the new * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are - * allowed to this database or not. Not supported for DataWarehouse edition. - * Possible values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this - * value is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' + * @member {date} [sourceDatabaseDeletionDate] Specifies the time that the + * database was deleted. + * @member {string} [recoveryServicesRecoveryPointId] The resource identifier + * of the recovery point associated with create operation of this database. + * @member {string} [longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * @member {string} [recoverableDatabaseId] The resource identifier of the + * recoverable database associated with create operation of this database. + * @member {string} [restorableDroppedDatabaseId] The resource identifier of + * the restorable dropped database associated with create operation of this + * database. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * @member {boolean} [zoneRedundant] Whether or not this database is zone * redundant, which means the replicas of this database will be spread across * multiple availability zones. + * @member {string} [licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {number} [maxLogSizeBytes] The max log size for this database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [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' + * @member {object} [currentSku] The name and tier of the SKU. + * @member {string} [currentSku.name] The name of the SKU, typically, a + * letter + Number code, e.g. P3. + * @member {string} [currentSku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * @member {string} [currentSku.size] Size of the particular SKU + * @member {string} [currentSku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * @member {number} [currentSku.capacity] Capacity of the particular SKU. + * @member {object} [tags] Resource tags. */ constructor() { - super(); } /** @@ -189,71 +149,60 @@ class DatabaseUpdate extends models['Resource'] { name: 'Composite', className: 'DatabaseUpdate', modelProperties: { - id: { + sku: { required: false, - readOnly: true, - serializedName: 'id', + serializedName: 'sku', type: { - name: 'String' + name: 'Composite', + className: 'Sku' } }, - name: { + createMode: { required: false, - readOnly: true, - serializedName: 'name', + serializedName: 'properties.createMode', type: { name: 'String' } }, - type: { + collation: { required: false, - readOnly: true, - serializedName: 'type', + serializedName: 'properties.collation', type: { name: 'String' } }, - tags: { + maxSizeBytes: { required: false, - serializedName: 'tags', + serializedName: 'properties.maxSizeBytes', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'Number' } }, - collation: { + sampleName: { required: false, - serializedName: 'properties.collation', + serializedName: 'properties.sampleName', type: { name: 'String' } }, - creationDate: { + elasticPoolId: { required: false, - readOnly: true, - serializedName: 'properties.creationDate', + serializedName: 'properties.elasticPoolId', type: { - name: 'DateTime' + name: 'String' } }, - containmentState: { + sourceDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.containmentState', + serializedName: 'properties.sourceDatabaseId', type: { - name: 'Number' + name: 'String' } }, - currentServiceObjectiveId: { + status: { required: false, readOnly: true, - serializedName: 'properties.currentServiceObjectiveId', + serializedName: 'properties.status', type: { name: 'String' } @@ -266,184 +215,153 @@ class DatabaseUpdate extends models['Resource'] { name: 'String' } }, - earliestRestoreDate: { + creationDate: { required: false, readOnly: true, - serializedName: 'properties.earliestRestoreDate', + serializedName: 'properties.creationDate', type: { name: 'DateTime' } }, - createMode: { + currentServiceObjectiveName: { required: false, - serializedName: 'properties.createMode', + readOnly: true, + serializedName: 'properties.currentServiceObjectiveName', type: { name: 'String' } }, - sourceDatabaseId: { + requestedServiceObjectiveName: { required: false, - serializedName: 'properties.sourceDatabaseId', + readOnly: true, + serializedName: 'properties.requestedServiceObjectiveName', type: { name: 'String' } }, - sourceDatabaseDeletionDate: { - required: false, - serializedName: 'properties.sourceDatabaseDeletionDate', - type: { - name: 'DateTime' - } - }, - restorePointInTime: { - required: false, - serializedName: 'properties.restorePointInTime', - type: { - name: 'DateTime' - } - }, - recoveryServicesRecoveryPointResourceId: { + defaultSecondaryLocation: { required: false, - serializedName: 'properties.recoveryServicesRecoveryPointResourceId', + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', type: { name: 'String' } }, - edition: { + failoverGroupId: { required: false, - serializedName: 'properties.edition', + readOnly: true, + serializedName: 'properties.failoverGroupId', type: { name: 'String' } }, - maxSizeBytes: { + restorePointInTime: { required: false, - serializedName: 'properties.maxSizeBytes', + serializedName: 'properties.restorePointInTime', type: { - name: 'String' + name: 'DateTime' } }, - requestedServiceObjectiveId: { + sourceDatabaseDeletionDate: { required: false, - serializedName: 'properties.requestedServiceObjectiveId', + serializedName: 'properties.sourceDatabaseDeletionDate', type: { - name: 'String' + name: 'DateTime' } }, - requestedServiceObjectiveName: { + recoveryServicesRecoveryPointId: { required: false, - serializedName: 'properties.requestedServiceObjectiveName', + serializedName: 'properties.recoveryServicesRecoveryPointId', type: { name: 'String' } }, - serviceLevelObjective: { + longTermRetentionBackupResourceId: { required: false, - readOnly: true, - serializedName: 'properties.serviceLevelObjective', + serializedName: 'properties.longTermRetentionBackupResourceId', type: { name: 'String' } }, - status: { + recoverableDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.status', + serializedName: 'properties.recoverableDatabaseId', type: { name: 'String' } }, - elasticPoolName: { + restorableDroppedDatabaseId: { required: false, - serializedName: 'properties.elasticPoolName', + serializedName: 'properties.restorableDroppedDatabaseId', type: { name: 'String' } }, - defaultSecondaryLocation: { + catalogCollation: { required: false, - readOnly: true, - serializedName: 'properties.defaultSecondaryLocation', + serializedName: 'properties.catalogCollation', type: { name: 'String' } }, - serviceTierAdvisors: { + zoneRedundant: { required: false, - readOnly: true, - serializedName: 'properties.serviceTierAdvisors', + serializedName: 'properties.zoneRedundant', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceTierAdvisorElementType', - type: { - name: 'Composite', - className: 'ServiceTierAdvisor' - } - } + name: 'Boolean' } }, - transparentDataEncryption: { + licenseType: { required: false, - readOnly: true, - serializedName: 'properties.transparentDataEncryption', + serializedName: 'properties.licenseType', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TransparentDataEncryptionElementType', - type: { - name: 'Composite', - className: 'TransparentDataEncryption' - } - } + name: 'String' } }, - recommendedIndex: { + maxLogSizeBytes: { required: false, readOnly: true, - serializedName: 'properties.recommendedIndex', + serializedName: 'properties.maxLogSizeBytes', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RecommendedIndexElementType', - type: { - name: 'Composite', - className: 'RecommendedIndex' - } - } + name: 'Number' } }, - failoverGroupId: { + earliestRestoreDate: { required: false, readOnly: true, - serializedName: 'properties.failoverGroupId', + serializedName: 'properties.earliestRestoreDate', type: { - name: 'String' + name: 'DateTime' } }, readScale: { required: false, serializedName: 'properties.readScale', type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] + name: 'String' } }, - sampleName: { + currentSku: { required: false, - serializedName: 'properties.sampleName', + readOnly: true, + serializedName: 'properties.currentSku', type: { - name: 'String' + name: 'Composite', + className: 'Sku' } }, - zoneRedundant: { + tags: { required: false, - serializedName: 'properties.zoneRedundant', + serializedName: 'tags', type: { - name: 'Boolean' + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } } } diff --git a/lib/services/sqlManagement2/lib/models/editionCapability.js b/lib/services/sqlManagement2/lib/models/editionCapability.js index 39b5d2959b..91c33a3d6d 100644 --- a/lib/services/sqlManagement2/lib/models/editionCapability.js +++ b/lib/services/sqlManagement2/lib/models/editionCapability.js @@ -13,19 +13,21 @@ const models = require('./index'); /** - * The database edition capabilities. + * The edition capability. * */ class EditionCapability { /** * Create a EditionCapability. - * @member {string} [name] The edition name. - * @member {string} [status] The status of the edition. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [name] The database edition name. * @member {array} [supportedServiceLevelObjectives] The list of supported * service objectives for the edition. * @member {boolean} [zoneRedundant] Whether or not zone redundancy is * supported for the edition. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -52,15 +54,6 @@ class EditionCapability { name: 'String' } }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] - } - }, supportedServiceLevelObjectives: { required: false, readOnly: true, @@ -84,6 +77,22 @@ class EditionCapability { type: { name: 'Boolean' } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/elasticPool.js b/lib/services/sqlManagement2/lib/models/elasticPool.js index 71a027af35..878e902fbf 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPool.js +++ b/lib/services/sqlManagement2/lib/models/elasticPool.js @@ -13,31 +13,41 @@ const models = require('./index'); /** - * Represents a database elastic pool. + * An elastic pool. * * @extends models['TrackedResource'] */ class ElasticPool extends models['TrackedResource'] { /** * Create a ElasticPool. - * @member {date} [creationDate] The creation date of the elastic pool - * (ISO8601 format). + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of elastic pool. This is metadata used for + * the Azure portal experience. * @member {string} [state] The state of the elastic pool. Possible values * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible - * values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic - * pool is zone redundant, which means the replicas of this database will be - * spread across multiple availability zones. - * @member {string} [kind] Kind of elastic pool. This is metadata used for - * the Azure portal experience. + * @member {date} [creationDate] The creation date of the elastic pool + * (ISO8601 format). + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity + * all databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity + * any one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' */ constructor() { super(); @@ -102,55 +112,51 @@ class ElasticPool extends models['TrackedResource'] { name: 'String' } }, - creationDate: { + sku: { required: false, - readOnly: true, - serializedName: 'properties.creationDate', + serializedName: 'sku', type: { - name: 'DateTime' + name: 'Composite', + className: 'Sku' } }, - state: { + kind: { required: false, readOnly: true, - serializedName: 'properties.state', + serializedName: 'kind', type: { name: 'String' } }, - edition: { + state: { required: false, - serializedName: 'properties.edition', + readOnly: true, + serializedName: 'properties.state', type: { name: 'String' } }, - dtu: { - required: false, - serializedName: 'properties.dtu', - type: { - name: 'Number' - } - }, - databaseDtuMax: { + creationDate: { required: false, - serializedName: 'properties.databaseDtuMax', + readOnly: true, + serializedName: 'properties.creationDate', type: { - name: 'Number' + name: 'DateTime' } }, - databaseDtuMin: { + maxSizeBytes: { required: false, - serializedName: 'properties.databaseDtuMin', + serializedName: 'properties.maxSizeBytes', type: { name: 'Number' } }, - storageMB: { + perDatabaseSettings: { required: false, - serializedName: 'properties.storageMB', + serializedName: 'properties.perDatabaseSettings', type: { - name: 'Number' + name: 'Composite', + className: 'ElasticPoolPerDatabaseSettings' } }, zoneRedundant: { @@ -160,10 +166,9 @@ class ElasticPool extends models['TrackedResource'] { name: 'Boolean' } }, - kind: { + licenseType: { required: false, - readOnly: true, - serializedName: 'kind', + serializedName: 'properties.licenseType', type: { name: 'String' } diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js b/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js index 72a2d06bbc..8363d79a3f 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js @@ -13,19 +13,21 @@ const models = require('./index'); /** - * The elastic pool edition capabilities. + * The elastic pool edition capability. * */ class ElasticPoolEditionCapability { /** * Create a ElasticPoolEditionCapability. * @member {string} [name] The elastic pool edition name. - * @member {string} [status] The status of the elastic pool edition. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedElasticPoolDtus] The list of supported elastic - * pool DTU levels for the edition. + * @member {array} [supportedElasticPoolPerformanceLevels] The list of + * supported elastic pool DTU levels for the edition. * @member {boolean} [zoneRedundant] Whether or not zone redundancy is * supported for the edition. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -52,27 +54,18 @@ class ElasticPoolEditionCapability { name: 'String' } }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] - } - }, - supportedElasticPoolDtus: { + supportedElasticPoolPerformanceLevels: { required: false, readOnly: true, - serializedName: 'supportedElasticPoolDtus', + serializedName: 'supportedElasticPoolPerformanceLevels', type: { name: 'Sequence', element: { required: false, - serializedName: 'ElasticPoolDtuCapabilityElementType', + serializedName: 'ElasticPoolPerformanceLevelCapabilityElementType', type: { name: 'Composite', - className: 'ElasticPoolDtuCapability' + className: 'ElasticPoolPerformanceLevelCapability' } } } @@ -84,6 +77,22 @@ class ElasticPoolEditionCapability { type: { name: 'Boolean' } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolListResult.js b/lib/services/sqlManagement2/lib/models/elasticPoolListResult.js index ab6f8122a9..d0c17d09a4 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolListResult.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolListResult.js @@ -11,11 +11,12 @@ 'use strict'; /** - * Represents the response to a list elastic pool request. + * The result of an elastic pool list request. */ class ElasticPoolListResult extends Array { /** * Create a ElasticPoolListResult. + * @member {string} [nextLink] Link to retrieve next page of results. */ constructor() { super(); @@ -36,7 +37,8 @@ class ElasticPoolListResult extends Array { className: 'ElasticPoolListResult', modelProperties: { value: { - required: true, + required: false, + readOnly: true, serializedName: '', type: { name: 'Sequence', @@ -49,6 +51,14 @@ class ElasticPoolListResult extends Array { } } } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMaxPerformanceLevelCapability.js b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMaxPerformanceLevelCapability.js new file mode 100644 index 0000000000..693b58f5d3 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMaxPerformanceLevelCapability.js @@ -0,0 +1,103 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The max per-database performance level capability. + * + */ +class ElasticPoolPerDatabaseMaxPerformanceLevelCapability { + /** + * Create a ElasticPoolPerDatabaseMaxPerformanceLevelCapability. + * @member {number} [limit] The maximum performance level per database. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + * @member {array} [supportedPerDatabaseMinPerformanceLevels] The list of + * supported min database performance levels. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ElasticPoolPerDatabaseMaxPerformanceLevelCapability + * + * @returns {object} metadata of ElasticPoolPerDatabaseMaxPerformanceLevelCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolPerDatabaseMaxPerformanceLevelCapability', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseMaxPerformanceLevelCapability', + modelProperties: { + limit: { + required: false, + readOnly: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + }, + supportedPerDatabaseMinPerformanceLevels: { + required: false, + readOnly: true, + serializedName: 'supportedPerDatabaseMinPerformanceLevels', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ElasticPoolPerDatabaseMinPerformanceLevelCapabilityElementType', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseMinPerformanceLevelCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolPerDatabaseMaxPerformanceLevelCapability; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMinPerformanceLevelCapability.js b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMinPerformanceLevelCapability.js new file mode 100644 index 0000000000..679c62dc47 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMinPerformanceLevelCapability.js @@ -0,0 +1,83 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The minimum per-database performance level capability. + * + */ +class ElasticPoolPerDatabaseMinPerformanceLevelCapability { + /** + * Create a ElasticPoolPerDatabaseMinPerformanceLevelCapability. + * @member {number} [limit] The minimum performance level per database. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ElasticPoolPerDatabaseMinPerformanceLevelCapability + * + * @returns {object} metadata of ElasticPoolPerDatabaseMinPerformanceLevelCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolPerDatabaseMinPerformanceLevelCapability', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseMinPerformanceLevelCapability', + modelProperties: { + limit: { + required: false, + readOnly: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolPerDatabaseMinPerformanceLevelCapability; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseSettings.js b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseSettings.js new file mode 100644 index 0000000000..5810f7eca6 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseSettings.js @@ -0,0 +1,62 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Per database settings of an elastic pool. + * + */ +class ElasticPoolPerDatabaseSettings { + /** + * Create a ElasticPoolPerDatabaseSettings. + * @member {number} [minCapacity] The minimum capacity all databases are + * guaranteed. + * @member {number} [maxCapacity] The maximum capacity any one database can + * consume. + */ + constructor() { + } + + /** + * Defines the metadata of ElasticPoolPerDatabaseSettings + * + * @returns {object} metadata of ElasticPoolPerDatabaseSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolPerDatabaseSettings', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseSettings', + modelProperties: { + minCapacity: { + required: false, + serializedName: 'minCapacity', + type: { + name: 'Number' + } + }, + maxCapacity: { + required: false, + serializedName: 'maxCapacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolPerDatabaseSettings; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolPerformanceLevelCapability.js b/lib/services/sqlManagement2/lib/models/elasticPoolPerformanceLevelCapability.js new file mode 100644 index 0000000000..444e9e51aa --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolPerformanceLevelCapability.js @@ -0,0 +1,193 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The Elastic Pool performance level capability. + * + */ +class ElasticPoolPerformanceLevelCapability { + /** + * Create a ElasticPoolPerformanceLevelCapability. + * @member {object} [performanceLevel] The performance level for the pool. + * @member {number} [performanceLevel.value] Performance level value. + * @member {string} [performanceLevel.unit] Unit type used to measure + * performance level. Possible values include: 'DTU', 'VCores' + * @member {object} [sku] The sku. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {number} [maxDatabaseCount] The maximum number of databases + * supported. + * @member {object} [includedMaxSize] The included (free) max size for this + * performance level. + * @member {number} [includedMaxSize.limit] The maximum size limit (see + * 'unit' for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {array} [supportedMaxSizes] The list of supported max sizes. + * @member {array} [supportedPerDatabaseMaxSizes] The list of supported per + * database max sizes. + * @member {array} [supportedPerDatabaseMaxPerformanceLevels] The list of + * supported per database max performance levels. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ElasticPoolPerformanceLevelCapability + * + * @returns {object} metadata of ElasticPoolPerformanceLevelCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolPerformanceLevelCapability', + type: { + name: 'Composite', + className: 'ElasticPoolPerformanceLevelCapability', + modelProperties: { + performanceLevel: { + required: false, + readOnly: true, + serializedName: 'performanceLevel', + type: { + name: 'Composite', + className: 'PerformanceLevelCapability' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + supportedLicenseTypes: { + required: false, + readOnly: true, + serializedName: 'supportedLicenseTypes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LicenseTypeCapabilityElementType', + type: { + name: 'Composite', + className: 'LicenseTypeCapability' + } + } + } + }, + maxDatabaseCount: { + required: false, + readOnly: true, + serializedName: 'maxDatabaseCount', + type: { + name: 'Number' + } + }, + includedMaxSize: { + required: false, + readOnly: true, + serializedName: 'includedMaxSize', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + supportedMaxSizes: { + required: false, + readOnly: true, + serializedName: 'supportedMaxSizes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } + } + }, + supportedPerDatabaseMaxSizes: { + required: false, + readOnly: true, + serializedName: 'supportedPerDatabaseMaxSizes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } + } + }, + supportedPerDatabaseMaxPerformanceLevels: { + required: false, + readOnly: true, + serializedName: 'supportedPerDatabaseMaxPerformanceLevels', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ElasticPoolPerDatabaseMaxPerformanceLevelCapabilityElementType', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseMaxPerformanceLevelCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolPerformanceLevelCapability; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js b/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js index c1de004d29..5535097575 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js @@ -13,33 +13,37 @@ const models = require('./index'); /** - * Represents an elastic pool update. + * An elastic pool update. * - * @extends models['Resource'] */ -class ElasticPoolUpdate extends models['Resource'] { +class ElasticPoolUpdate { /** * Create a ElasticPoolUpdate. + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity + * all databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity + * any one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' * @member {object} [tags] Resource tags. - * @member {date} [creationDate] The creation date of the elastic pool - * (ISO8601 format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible - * values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic - * pool is zone redundant, which means the replicas of this database will be - * spread across multiple availability zones. */ constructor() { - super(); } /** @@ -56,26 +60,39 @@ class ElasticPoolUpdate extends models['Resource'] { name: 'Composite', className: 'ElasticPoolUpdate', modelProperties: { - id: { + sku: { required: false, - readOnly: true, - serializedName: 'id', + serializedName: 'sku', type: { - name: 'String' + name: 'Composite', + className: 'Sku' } }, - name: { + maxSizeBytes: { required: false, - readOnly: true, - serializedName: 'name', + serializedName: 'properties.maxSizeBytes', type: { - name: 'String' + name: 'Number' + } + }, + perDatabaseSettings: { + required: false, + serializedName: 'properties.perDatabaseSettings', + type: { + name: 'Composite', + className: 'ElasticPoolPerDatabaseSettings' + } + }, + zoneRedundant: { + required: false, + serializedName: 'properties.zoneRedundant', + type: { + name: 'Boolean' } }, - type: { + licenseType: { required: false, - readOnly: true, - serializedName: 'type', + serializedName: 'properties.licenseType', type: { name: 'String' } @@ -93,64 +110,6 @@ class ElasticPoolUpdate extends models['Resource'] { } } } - }, - creationDate: { - required: false, - readOnly: true, - serializedName: 'properties.creationDate', - type: { - name: 'DateTime' - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'properties.state', - type: { - name: 'String' - } - }, - edition: { - required: false, - serializedName: 'properties.edition', - type: { - name: 'String' - } - }, - dtu: { - required: false, - serializedName: 'properties.dtu', - type: { - name: 'Number' - } - }, - databaseDtuMax: { - required: false, - serializedName: 'properties.databaseDtuMax', - type: { - name: 'Number' - } - }, - databaseDtuMin: { - required: false, - serializedName: 'properties.databaseDtuMin', - type: { - name: 'Number' - } - }, - storageMB: { - required: false, - serializedName: 'properties.storageMB', - type: { - name: 'Number' - } - }, - zoneRedundant: { - required: false, - serializedName: 'properties.zoneRedundant', - type: { - name: 'Boolean' - } } } } diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index 8809868c22..e291789c89 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -108,212 +108,6 @@ export interface RestorableDroppedDatabase extends ProxyResource { readonly earliestRestoreDate?: Date; } -/** - * @class - * Initializes a new instance of the MaxSizeCapability class. - * @constructor - * The maximum size limits for a database. - * - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). - * @member {string} [unit] The units that the limit is expressed in. Possible - * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' - * @member {string} [status] The status of the maximum size capability. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - */ -export interface MaxSizeCapability { - readonly limit?: number; - readonly unit?: string; - readonly status?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceObjectiveCapability class. - * @constructor - * The service objectives capability. - * - * @member {string} [name] The service objective name. - * @member {string} [status] The status of the service objective. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {string} [unit] Unit type used to measure service objective - * performance level. Possible values include: 'DTU' - * @member {number} [value] Performance level value. - * @member {uuid} [id] The unique ID of the service objective. - * @member {array} [supportedMaxSizes] The list of supported maximum database - * sizes for this service objective. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). - * @member {string} [includedMaxSize.unit] The units that the limit is - * expressed in. Possible values include: 'Megabytes', 'Gigabytes', - * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' - */ -export interface ServiceObjectiveCapability { - readonly name?: string; - readonly status?: string; - readonly unit?: string; - readonly value?: number; - readonly id?: string; - readonly supportedMaxSizes?: MaxSizeCapability[]; - readonly includedMaxSize?: MaxSizeCapability; -} - -/** - * @class - * Initializes a new instance of the EditionCapability class. - * @constructor - * The database edition capabilities. - * - * @member {string} [name] The edition name. - * @member {string} [status] The status of the edition. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedServiceLevelObjectives] The list of supported - * service objectives for the edition. - * @member {boolean} [zoneRedundant] Whether or not zone redundancy is - * supported for the edition. - */ -export interface EditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; - readonly zoneRedundant?: boolean; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolPerDatabaseMinDtuCapability class. - * @constructor - * The minimum per-database DTU capability. - * - * @member {number} [limit] The maximum DTUs per database. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - */ -export interface ElasticPoolPerDatabaseMinDtuCapability { - readonly limit?: number; - readonly status?: string; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolPerDatabaseMaxDtuCapability class. - * @constructor - * The max per-database DTU capability. - * - * @member {number} [limit] The maximum DTUs per database. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedPerDatabaseMinDtus] The list of supported min - * database DTUs. - */ -export interface ElasticPoolPerDatabaseMaxDtuCapability { - readonly limit?: number; - readonly status?: string; - readonly supportedPerDatabaseMinDtus?: ElasticPoolPerDatabaseMinDtuCapability[]; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolDtuCapability class. - * @constructor - * The Elastic Pool DTU capability. - * - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). - * @member {number} [maxDatabaseCount] The maximum number of databases - * supported. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedMaxSizes] The list of supported max sizes. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). - * @member {string} [includedMaxSize.unit] The units that the limit is - * expressed in. Possible values include: 'Megabytes', 'Gigabytes', - * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' - * @member {array} [supportedPerDatabaseMaxSizes] The list of supported max - * database sizes. - * @member {array} [supportedPerDatabaseMaxDtus] The list of supported max - * database DTUs. - */ -export interface ElasticPoolDtuCapability { - readonly limit?: number; - readonly maxDatabaseCount?: number; - readonly status?: string; - readonly supportedMaxSizes?: MaxSizeCapability[]; - readonly includedMaxSize?: MaxSizeCapability; - readonly supportedPerDatabaseMaxSizes?: MaxSizeCapability[]; - readonly supportedPerDatabaseMaxDtus?: ElasticPoolPerDatabaseMaxDtuCapability[]; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolEditionCapability class. - * @constructor - * The elastic pool edition capabilities. - * - * @member {string} [name] The elastic pool edition name. - * @member {string} [status] The status of the elastic pool edition. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedElasticPoolDtus] The list of supported elastic - * pool DTU levels for the edition. - * @member {boolean} [zoneRedundant] Whether or not zone redundancy is - * supported for the edition. - */ -export interface ElasticPoolEditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedElasticPoolDtus?: ElasticPoolDtuCapability[]; - readonly zoneRedundant?: boolean; -} - -/** - * @class - * Initializes a new instance of the ServerVersionCapability class. - * @constructor - * The server capabilities. - * - * @member {string} [name] The server version name. - * @member {string} [status] The status of the server version. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedEditions] The list of supported database editions. - * @member {array} [supportedElasticPoolEditions] The list of supported elastic - * pool editions. - */ -export interface ServerVersionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedEditions?: EditionCapability[]; - readonly supportedElasticPoolEditions?: ElasticPoolEditionCapability[]; -} - -/** - * @class - * Initializes a new instance of the LocationCapabilities class. - * @constructor - * The capabilities for a location. - * - * @member {string} [name] The location name. - * @member {string} [status] Azure SQL Database's status for the location. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedServerVersions] The list of supported server - * versions. - */ -export interface LocationCapabilities { - readonly name?: string; - readonly status?: string; - readonly supportedServerVersions?: ServerVersionCapability[]; -} - /** * @class * Initializes a new instance of the CheckNameAvailabilityRequest class. @@ -368,113 +162,662 @@ export interface ServerConnectionPolicy extends ProxyResource { /** * @class - * Initializes a new instance of the SloUsageMetric class. + * Initializes a new instance of the DatabaseSecurityAlertPolicy class. * @constructor - * A Slo Usage Metric. + * Contains information about a database Threat Detection policy. * - * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'System', 'System0', 'System1', - * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', - * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', - * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', - * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', - * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', - * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', - * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO - * usage metric. - * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO - * usage metric. + * @member {string} [location] The geo-location where the resource lives + * @member {string} [kind] Resource kind. + * @member {string} state Specifies the state of the policy. If state is + * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible + * values include: 'New', 'Enabled', 'Disabled' + * @member {string} [disabledAlerts] Specifies the semicolon-separated list of + * alerts that are disabled, or empty string to disable no alerts. Possible + * values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; + * Usage_Anomaly. + * @member {string} [emailAddresses] Specifies the semicolon-separated list of + * e-mail addresses to which the alert is sent. + * @member {string} [emailAccountAdmins] Specifies that the alert is sent to + * the account administrators. Possible values include: 'Enabled', 'Disabled' + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all + * Threat Detection audit logs. If state is Enabled, storageEndpoint is + * required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the Threat Detection audit storage account. If state is Enabled, + * storageAccountAccessKey is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * Threat Detection audit logs. + * @member {string} [useServerDefault] Specifies whether to use the default + * server policy. Possible values include: 'Enabled', 'Disabled' */ -export interface SloUsageMetric { - readonly serviceLevelObjective?: string; - readonly serviceLevelObjectiveId?: string; - readonly inRangeTimeRatio?: number; +export interface DatabaseSecurityAlertPolicy extends ProxyResource { + location?: string; + readonly kind?: string; + state: string; + disabledAlerts?: string; + emailAddresses?: string; + emailAccountAdmins?: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + useServerDefault?: string; } /** * @class - * Initializes a new instance of the ServiceTierAdvisor class. + * Initializes a new instance of the DataMaskingPolicy class. * @constructor - * Represents a Service Tier Advisor. + * Represents a database data masking policy. * - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [activeTimeRatio] The activeTimeRatio for service tier - * advisor. - * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. - * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. - * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. - * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier - * advisor. - * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets - * serviceLevelObjectiveUsageMetrics for the service tier advisor. - * @member {string} [currentServiceLevelObjective] Gets or sets - * currentServiceLevelObjective for service tier advisor. - * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets - * currentServiceLevelObjectiveId for service tier advisor. - * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or - * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or - * sets usageBasedRecommendationServiceLevelObjectiveId for service tier - * advisor. - * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets - * overallRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets - * overallRecommendationServiceLevelObjectiveId for service tier advisor. - * @member {number} [confidence] Gets or sets confidence for service tier - * advisor. - */ -export interface ServiceTierAdvisor extends ProxyResource { - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly activeTimeRatio?: number; - readonly minDtu?: number; - readonly avgDtu?: number; - readonly maxDtu?: number; - readonly maxSizeInGB?: number; - readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; - readonly currentServiceLevelObjective?: string; - readonly currentServiceLevelObjectiveId?: string; - readonly usageBasedRecommendationServiceLevelObjective?: string; - readonly usageBasedRecommendationServiceLevelObjectiveId?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; - readonly overallRecommendationServiceLevelObjective?: string; - readonly overallRecommendationServiceLevelObjectiveId?: string; - readonly confidence?: number; + * @member {string} dataMaskingState The state of the data masking policy. + * Possible values include: 'Disabled', 'Enabled' + * @member {string} [exemptPrincipals] The list of the exempt principals. + * Specifies the semicolon-separated list of database users for which the data + * masking policy does not apply. The specified users receive data results + * without masking for all of the database queries. + * @member {string} [applicationPrincipals] The list of the application + * principals. This is a legacy parameter and is no longer used. + * @member {string} [maskingLevel] The masking level. This is a legacy + * parameter and is no longer used. + * @member {string} [location] The location of the data masking policy. + * @member {string} [kind] The kind of data masking policy. Metadata, used for + * Azure portal. + */ +export interface DataMaskingPolicy extends ProxyResource { + dataMaskingState: string; + exemptPrincipals?: string; + readonly applicationPrincipals?: string; + readonly maskingLevel?: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the DataMaskingRule class. + * @constructor + * Represents a database data masking rule. + * + * @member {string} [dataMaskingRuleId] The rule Id. + * @member {string} [aliasName] The alias name. This is a legacy parameter and + * is no longer used. + * @member {string} [ruleState] The rule state. Used to delete a rule. To + * delete an existing rule, specify the schemaName, tableName, columnName, + * maskingFunction, and specify ruleState as disabled. However, if the rule + * doesn't already exist, the rule will be created with ruleState set to + * enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} schemaName The schema name on which the data masking rule + * is applied. + * @member {string} tableName The table name on which the data masking rule is + * applied. + * @member {string} columnName The column name on which the data masking rule + * is applied. + * @member {string} maskingFunction The masking function that is used for the + * data masking rule. Possible values include: 'Default', 'CCN', 'Email', + * 'Number', 'SSN', 'Text' + * @member {string} [numberFrom] The numberFrom property of the masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [numberTo] The numberTo property of the data masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [prefixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked in the beginning of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [suffixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked at the end of the string. Otherwise, this + * parameter will be ignored. + * @member {string} [replacementString] If maskingFunction is set to Text, the + * character to use for masking the unexposed part of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [location] The location of the data masking rule. + * @member {string} [kind] The kind of Data Masking Rule. Metadata, used for + * Azure portal. + */ +export interface DataMaskingRule extends ProxyResource { + readonly dataMaskingRuleId?: string; + aliasName?: string; + ruleState?: string; + schemaName: string; + tableName: string; + columnName: string; + maskingFunction: string; + numberFrom?: string; + numberTo?: string; + prefixSize?: string; + suffixSize?: string; + replacementString?: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the FirewallRule class. + * @constructor + * Represents a server firewall rule. + * + * @member {string} [kind] Kind of server that contains this firewall rule. + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {string} startIpAddress The start IP address of the firewall rule. + * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP + * addresses. + * @member {string} endIpAddress The end IP address of the firewall rule. Must + * be IPv4 format. Must be greater than or equal to startIpAddress. Use value + * '0.0.0.0' to represent all Azure-internal IP addresses. + */ +export interface FirewallRule extends ProxyResource { + readonly kind?: string; + readonly location?: string; + startIpAddress: string; + endIpAddress: string; +} + +/** + * @class + * Initializes a new instance of the GeoBackupPolicy class. + * @constructor + * A database geo backup policy. + * + * @member {string} state The state of the geo backup policy. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} [storageType] The storage type of the geo backup policy. + * @member {string} [kind] Kind of geo backup policy. This is metadata used + * for the Azure portal experience. + * @member {string} [location] Backup policy location. + */ +export interface GeoBackupPolicy extends ProxyResource { + state: string; + readonly storageType?: string; + readonly kind?: string; + readonly location?: string; +} + +/** + * @class + * Initializes a new instance of the ImportExtensionRequest class. + * @constructor + * Import database parameters. + * + * @member {string} [name] The name of the extension. + * @member {string} [type] The type of the extension. + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + */ +export interface ImportExtensionRequest { + name?: string; + type?: string; + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; +} + +/** + * @class + * Initializes a new instance of the ImportExportResponse class. + * @constructor + * Response for Import/Export Get operation. + * + * @member {string} [requestType] The request type of the operation. + * @member {uuid} [requestId] The request type of the operation. + * @member {string} [serverName] The name of the server. + * @member {string} [databaseName] The name of the database. + * @member {string} [status] The status message returned from the server. + * @member {string} [lastModifiedTime] The operation status last modified time. + * @member {string} [queuedTime] The operation queued time. + * @member {string} [blobUri] The blob uri. + * @member {string} [errorMessage] The error message returned from the server. + */ +export interface ImportExportResponse extends ProxyResource { + readonly requestType?: string; + readonly requestId?: string; + readonly serverName?: string; + readonly databaseName?: string; + readonly status?: string; + readonly lastModifiedTime?: string; + readonly queuedTime?: string; + readonly blobUri?: string; + readonly errorMessage?: string; +} + +/** + * @class + * Initializes a new instance of the ExportRequest class. + * @constructor + * Export database parameters. + * + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + */ +export interface ExportRequest { + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; +} + +/** + * @class + * Initializes a new instance of the ImportRequest class. + * @constructor + * Import database parameters. + * + * @member {string} databaseName The name of the database to import. + * @member {string} edition The edition for the database being created. + * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @member {string} serviceObjectiveName The name of the service objective to + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', + * 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', + * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', + * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {string} maxSizeBytes The maximum size for the newly imported + * database. + */ +export interface ImportRequest extends ExportRequest { + databaseName: string; + edition: string; + serviceObjectiveName: string; + maxSizeBytes: string; +} + +/** + * @class + * Initializes a new instance of the MetricValue class. + * @constructor + * Represents database metrics. + * + * @member {number} [count] The number of values for the metric. + * @member {number} [average] The average value of the metric. + * @member {number} [maximum] The max value of the metric. + * @member {number} [minimum] The min value of the metric. + * @member {date} [timestamp] The metric timestamp (ISO-8601 format). + * @member {number} [total] The total value of the metric. + */ +export interface MetricValue { + readonly count?: number; + readonly average?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly timestamp?: Date; + readonly total?: number; +} + +/** + * @class + * Initializes a new instance of the MetricName class. + * @constructor + * A database metric name. + * + * @member {string} [value] The name of the database metric. + * @member {string} [localizedValue] The friendly name of the database metric. + */ +export interface MetricName { + readonly value?: string; + readonly localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the Metric class. + * @constructor + * Database metrics. + * + * @member {date} [startTime] The start time for the metric (ISO-8601 format). + * @member {date} [endTime] The end time for the metric (ISO-8601 format). + * @member {string} [timeGrain] The time step to be used to summarize the + * metric values. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'count', 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {array} [metricValues] The metric values for the specified time + * window and timestep. + */ +export interface Metric { + readonly startTime?: Date; + readonly endTime?: Date; + readonly timeGrain?: string; + readonly unit?: string; + readonly name?: MetricName; + readonly metricValues?: MetricValue[]; +} + +/** + * @class + * Initializes a new instance of the MetricAvailability class. + * @constructor + * A metric availability value. + * + * @member {string} [retention] The length of retention for the database + * metric. + * @member {string} [timeGrain] The granularity of the database metric. + */ +export interface MetricAvailability { + readonly retention?: string; + readonly timeGrain?: string; +} + +/** + * @class + * Initializes a new instance of the MetricDefinition class. + * @constructor + * A database metric definition. + * + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {string} [primaryAggregationType] The primary aggregation type + * defining how metric values are displayed. Possible values include: 'None', + * 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + * @member {string} [resourceUri] The resource uri of the database. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + * @member {array} [metricAvailabilities] The list of database metric + * availabities for the metric. + */ +export interface MetricDefinition { + readonly name?: MetricName; + readonly primaryAggregationType?: string; + readonly resourceUri?: string; + readonly unit?: string; + readonly metricAvailabilities?: MetricAvailability[]; +} + +/** + * @class + * Initializes a new instance of the RecommendedElasticPoolMetric class. + * @constructor + * Represents recommended elastic pool metric. + * + * @member {date} [dateTime] The time of metric (ISO8601 format). + * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). + * See + * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + * @member {number} [sizeGB] Gets or sets size in gigabytes. + */ +export interface RecommendedElasticPoolMetric { + dateTime?: Date; + dtu?: number; + sizeGB?: number; +} + +/** + * @class + * Initializes a new instance of the RecommendedElasticPool class. + * @constructor + * Represents a recommented elastic pool. + * + * @member {string} [databaseEdition] The edition of the recommended elastic + * pool. The ElasticPoolEdition enumeration contains all the valid editions. + * Possible values include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The DTU for the recommended elastic pool. + * @member {number} [databaseDtuMin] The minimum DTU for the database. + * @member {number} [databaseDtuMax] The maximum DTU for the database. + * @member {number} [storageMB] Gets storage size in megabytes. + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 + * format). + * @member {number} [maxObservedDtu] Gets maximum observed DTU. + * @member {number} [maxObservedStorageMB] Gets maximum observed storage in + * megabytes. + * @member {array} [databases] The list of databases in this pool. Expanded + * property + * @member {array} [metrics] The list of databases housed in the server. + * Expanded property + */ +export interface RecommendedElasticPool extends ProxyResource { + readonly databaseEdition?: string; + dtu?: number; + databaseDtuMin?: number; + databaseDtuMax?: number; + storageMB?: number; + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly maxObservedDtu?: number; + readonly maxObservedStorageMB?: number; + readonly databases?: TrackedResource[]; + readonly metrics?: RecommendedElasticPoolMetric[]; +} + +/** + * @class + * Initializes a new instance of the ReplicationLink class. + * @constructor + * Represents a database replication link. + * + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {boolean} [isTerminationAllowed] Legacy value indicating whether + * termination is allowed. Currently always returns true. + * @member {string} [replicationMode] Replication mode of this replication + * link. + * @member {string} [partnerServer] The name of the server hosting the partner + * database. + * @member {string} [partnerDatabase] The name of the partner database. + * @member {string} [partnerLocation] The Azure Region of the partner database. + * @member {string} [role] The role of the database in the replication link. + * Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', + * 'Source', 'Copy' + * @member {string} [partnerRole] The role of the partner database in the + * replication link. Possible values include: 'Primary', 'Secondary', + * 'NonReadableSecondary', 'Source', 'Copy' + * @member {date} [startTime] The start time for the replication link. + * @member {number} [percentComplete] The percentage of seeding complete for + * the replication link. + * @member {string} [replicationState] The replication state for the + * replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + * 'SUSPENDED' + */ +export interface ReplicationLink extends ProxyResource { + readonly location?: string; + readonly isTerminationAllowed?: boolean; + readonly replicationMode?: string; + readonly partnerServer?: string; + readonly partnerDatabase?: string; + readonly partnerLocation?: string; + readonly role?: string; + readonly partnerRole?: string; + readonly startTime?: Date; + readonly percentComplete?: number; + readonly replicationState?: string; +} + +/** + * @class + * Initializes a new instance of the ServerAzureADAdministrator class. + * @constructor + * An server Active Directory Administrator. + * + * @member {string} login The server administrator login value. + * @member {uuid} sid The server administrator Sid (Secure ID). + * @member {uuid} tenantId The server Active Directory Administrator tenant id. + */ +export interface ServerAzureADAdministrator extends ProxyResource { + login: string; + sid: string; + tenantId: string; +} + +/** + * @class + * Initializes a new instance of the ServerCommunicationLink class. + * @constructor + * Server communication link. + * + * @member {string} [state] The state. + * @member {string} partnerServer The name of the partner server. + * @member {string} [location] Communication link location. + * @member {string} [kind] Communication link kind. This property is used for + * Azure Portal metadata. + */ +export interface ServerCommunicationLink extends ProxyResource { + readonly state?: string; + partnerServer: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceObjective class. + * @constructor + * Represents a database service objective. + * + * @member {string} [serviceObjectiveName] The name for the service objective. + * @member {boolean} [isDefault] Gets whether the service level objective is + * the default service objective. + * @member {boolean} [isSystem] Gets whether the service level objective is a + * system service objective. + * @member {string} [description] The description for the service level + * objective. + * @member {boolean} [enabled] Gets whether the service level objective is + * enabled. + */ +export interface ServiceObjective extends ProxyResource { + readonly serviceObjectiveName?: string; + readonly isDefault?: boolean; + readonly isSystem?: boolean; + readonly description?: string; + readonly enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the ElasticPoolActivity class. + * @constructor + * Represents the activity on an elastic pool. + * + * @member {string} [location] The geo-location where the resource lives + * @member {date} [endTime] The time the operation finished (ISO8601 format). + * @member {number} [errorCode] The error code if available. + * @member {string} [errorMessage] The error message if available. + * @member {number} [errorSeverity] The error severity if available. + * @member {string} [operation] The operation name. + * @member {uuid} [operationId] The unique operation ID. + * @member {number} [percentComplete] The percentage complete if available. + * @member {number} [requestedDatabaseDtuMax] The requested max DTU per + * database if available. + * @member {number} [requestedDatabaseDtuMin] The requested min DTU per + * database if available. + * @member {number} [requestedDtu] The requested DTU for the pool if available. + * @member {string} [requestedElasticPoolName] The requested name for the + * elastic pool if available. + * @member {number} [requestedStorageLimitInGB] The requested storage limit for + * the pool in GB if available. + * @member {string} [elasticPoolName] The name of the elastic pool. + * @member {string} [serverName] The name of the server the elastic pool is in. + * @member {date} [startTime] The time the operation started (ISO8601 format). + * @member {string} [state] The current state of the operation. + * @member {number} [requestedStorageLimitInMB] The requested storage limit in + * MB. + * @member {number} [requestedDatabaseDtuGuarantee] The requested per database + * DTU guarantee. + * @member {number} [requestedDatabaseDtuCap] The requested per database DTU + * cap. + * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. + */ +export interface ElasticPoolActivity extends ProxyResource { + location?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; + readonly percentComplete?: number; + readonly requestedDatabaseDtuMax?: number; + readonly requestedDatabaseDtuMin?: number; + readonly requestedDtu?: number; + readonly requestedElasticPoolName?: string; + readonly requestedStorageLimitInGB?: number; + readonly elasticPoolName?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly requestedStorageLimitInMB?: number; + readonly requestedDatabaseDtuGuarantee?: number; + readonly requestedDatabaseDtuCap?: number; + readonly requestedDtuGuarantee?: number; } /** * @class - * Initializes a new instance of the TransparentDataEncryption class. + * Initializes a new instance of the ElasticPoolDatabaseActivity class. * @constructor - * Represents a database transparent data encryption configuration. + * Represents the activity on an elastic pool. * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database transparent data - * encryption. Possible values include: 'Enabled', 'Disabled' + * @member {string} [location] The geo-location where the resource lives + * @member {string} [databaseName] The database name. + * @member {date} [endTime] The time the operation finished (ISO8601 format). + * @member {number} [errorCode] The error code if available. + * @member {string} [errorMessage] The error message if available. + * @member {number} [errorSeverity] The error severity if available. + * @member {string} [operation] The operation name. + * @member {uuid} [operationId] The unique operation ID. + * @member {number} [percentComplete] The percentage complete if available. + * @member {string} [requestedElasticPoolName] The name for the elastic pool + * the database is moving into if available. + * @member {string} [currentElasticPoolName] The name of the current elastic + * pool the database is in if available. + * @member {string} [currentServiceObjective] The name of the current service + * objective if available. + * @member {string} [requestedServiceObjective] The name of the requested + * service objective if available. + * @member {string} [serverName] The name of the server the elastic pool is in. + * @member {date} [startTime] The time the operation started (ISO8601 format). + * @member {string} [state] The current state of the operation. */ -export interface TransparentDataEncryption extends ProxyResource { - readonly location?: string; - status?: string; +export interface ElasticPoolDatabaseActivity extends ProxyResource { + location?: string; + readonly databaseName?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; + readonly percentComplete?: number; + readonly requestedElasticPoolName?: string; + readonly currentElasticPoolName?: string; + readonly currentServiceObjective?: string; + readonly requestedServiceObjective?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; } /** @@ -544,123 +887,27 @@ export interface RecommendedIndex extends ProxyResource { /** * @class - * Initializes a new instance of the Database class. + * Initializes a new instance of the TransparentDataEncryption class. * @constructor - * Represents a database. - * - * @member {string} [kind] Kind of database. This is metadata used for the - * Azure portal experience. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * Represents a database transparent data encryption configuration. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @member {string} [location] Resource location. + * @member {string} [status] The status of the database transparent data + * encryption. Possible values include: 'Enabled', 'Disabled' + */ +export interface TransparentDataEncryption extends ProxyResource { + readonly location?: string; + status?: string; +} + +/** + * @class + * Initializes a new instance of the SloUsageMetric class. + * @constructor + * A Slo Usage Metric. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'System', 'System0', 'System1', + * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO + * usage metric. Possible values include: 'System', 'System0', 'System1', * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', @@ -669,244 +916,84 @@ export interface RecommendedIndex extends ProxyResource { * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' - * @member {boolean} [zoneRedundant] Whether or not this database is zone - * redundant, which means the replicas of this database will be spread across - * multiple availability zones. + * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO + * usage metric. + * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO + * usage metric. */ -export interface Database extends TrackedResource { - readonly kind?: string; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; +export interface SloUsageMetric { readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; - zoneRedundant?: boolean; + readonly serviceLevelObjectiveId?: string; + readonly inRangeTimeRatio?: number; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the ServiceTierAdvisor class. * @constructor - * Represents a database update. + * Represents a Service Tier Advisor. * - * @member {object} [tags] Resource tags. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'System', 'System0', 'System1', - * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', - * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', - * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', - * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', - * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', - * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', - * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' - * @member {boolean} [zoneRedundant] Whether or not this database is zone - * redundant, which means the replicas of this database will be spread across - * multiple availability zones. + * @member {number} [activeTimeRatio] The activeTimeRatio for service tier + * advisor. + * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. + * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. + * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. + * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier + * advisor. + * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets + * serviceLevelObjectiveUsageMetrics for the service tier advisor. + * @member {string} [currentServiceLevelObjective] Gets or sets + * currentServiceLevelObjective for service tier advisor. + * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets + * currentServiceLevelObjectiveId for service tier advisor. + * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or + * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or + * sets usageBasedRecommendationServiceLevelObjectiveId for service tier + * advisor. + * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets + * overallRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets + * overallRecommendationServiceLevelObjectiveId for service tier advisor. + * @member {number} [confidence] Gets or sets confidence for service tier + * advisor. */ -export interface DatabaseUpdate extends Resource { - tags?: { [propertyName: string]: string }; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; - zoneRedundant?: boolean; +export interface ServiceTierAdvisor extends ProxyResource { + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly activeTimeRatio?: number; + readonly minDtu?: number; + readonly avgDtu?: number; + readonly maxDtu?: number; + readonly maxSizeInGB?: number; + readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; + readonly currentServiceLevelObjective?: string; + readonly currentServiceLevelObjectiveId?: string; + readonly usageBasedRecommendationServiceLevelObjective?: string; + readonly usageBasedRecommendationServiceLevelObjectiveId?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; + readonly overallRecommendationServiceLevelObjective?: string; + readonly overallRecommendationServiceLevelObjectiveId?: string; + readonly confidence?: number; } /** @@ -929,1728 +1016,1841 @@ export interface TransparentDataEncryptionActivity extends ProxyResource { /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the ServerUsage class. * @constructor - * Represents the activity on an elastic pool. + * Represents server metrics. * - * @member {string} [location] The geo-location where the resource lives - * @member {string} [databaseName] The database name. - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {string} [requestedElasticPoolName] The name for the elastic pool - * the database is moving into if available. - * @member {string} [currentElasticPoolName] The name of the current elastic - * pool the database is in if available. - * @member {string} [currentServiceObjective] The name of the current service - * objective if available. - * @member {string} [requestedServiceObjective] The name of the requested - * service objective if available. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. + * @member {string} [name] Name of the server usage metric. + * @member {string} [resourceName] The name of the resource. + * @member {string} [displayName] The metric display name. + * @member {number} [currentValue] The current value of the metric. + * @member {number} [limit] The current limit of the metric. + * @member {string} [unit] The units of the metric. + * @member {date} [nextResetTime] The next reset time for the metric (ISO8601 + * format). */ -export interface ElasticPoolDatabaseActivity extends ProxyResource { - location?: string; - readonly databaseName?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedElasticPoolName?: string; - readonly currentElasticPoolName?: string; - readonly currentServiceObjective?: string; - readonly requestedServiceObjective?: string; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; +export interface ServerUsage { + readonly name?: string; + readonly resourceName?: string; + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; + readonly nextResetTime?: Date; } /** * @class - * Initializes a new instance of the ElasticPoolActivity class. + * Initializes a new instance of the DatabaseUsage class. * @constructor - * Represents the activity on an elastic pool. + * The database usages. * - * @member {string} [location] The geo-location where the resource lives - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {number} [requestedDatabaseDtuMax] The requested max DTU per - * database if available. - * @member {number} [requestedDatabaseDtuMin] The requested min DTU per - * database if available. - * @member {number} [requestedDtu] The requested DTU for the pool if available. - * @member {string} [requestedElasticPoolName] The requested name for the - * elastic pool if available. - * @member {number} [requestedStorageLimitInGB] The requested storage limit for - * the pool in GB if available. - * @member {string} [elasticPoolName] The name of the elastic pool. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. - * @member {number} [requestedStorageLimitInMB] The requested storage limit in - * MB. - * @member {number} [requestedDatabaseDtuGuarantee] The requested per database - * DTU guarantee. - * @member {number} [requestedDatabaseDtuCap] The requested per database DTU - * cap. - * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. + * @member {string} [name] The name of the usage metric. + * @member {string} [resourceName] The name of the resource. + * @member {string} [displayName] The usage metric display name. + * @member {number} [currentValue] The current value of the usage metric. + * @member {number} [limit] The current limit of the usage metric. + * @member {string} [unit] The units of the usage metric. + * @member {date} [nextResetTime] The next reset time for the usage metric + * (ISO8601 format). */ -export interface ElasticPoolActivity extends ProxyResource { - location?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedDatabaseDtuMax?: number; - readonly requestedDatabaseDtuMin?: number; - readonly requestedDtu?: number; - readonly requestedElasticPoolName?: string; - readonly requestedStorageLimitInGB?: number; - readonly elasticPoolName?: string; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly requestedStorageLimitInMB?: number; - readonly requestedDatabaseDtuGuarantee?: number; - readonly requestedDatabaseDtuCap?: number; - readonly requestedDtuGuarantee?: number; +export interface DatabaseUsage { + readonly name?: string; + readonly resourceName?: string; + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; + readonly nextResetTime?: Date; } /** * @class - * Initializes a new instance of the RecommendedElasticPoolMetric class. + * Initializes a new instance of the DatabaseBlobAuditingPolicy class. * @constructor - * Represents recommended elastic pool metric. + * A database blob auditing policy. * - * @member {date} [dateTime] The time of metric (ISO8601 format). - * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). - * See - * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - * @member {number} [sizeGB] Gets or sets size in gigabytes. + * @member {string} [kind] Resource kind. + * @member {string} state Specifies the state of the policy. If state is + * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible + * values include: 'Enabled', 'Disabled' + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, + * storageEndpoint is required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the auditing storage account. If state is Enabled, storageAccountAccessKey + * is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * audit logs. + * @member {array} [auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage + * subscription Id. + * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. */ -export interface RecommendedElasticPoolMetric { - dateTime?: Date; - dtu?: number; - sizeGB?: number; +export interface DatabaseBlobAuditingPolicy extends ProxyResource { + readonly kind?: string; + state: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + auditActionsAndGroups?: string[]; + storageAccountSubscriptionId?: string; + isStorageSecondaryKeyInUse?: boolean; } /** * @class - * Initializes a new instance of the RecommendedElasticPool class. + * Initializes a new instance of the AutomaticTuningOptions class. * @constructor - * Represents a recommented elastic pool. + * Automatic tuning properties for individual advisors. * - * @member {string} [databaseEdition] The edition of the recommended elastic - * pool. The ElasticPoolEdition enumeration contains all the valid editions. - * Possible values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The DTU for the recommended elastic pool. - * @member {number} [databaseDtuMin] The minimum DTU for the database. - * @member {number} [databaseDtuMax] The maximum DTU for the database. - * @member {number} [storageMB] Gets storage size in megabytes. - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [maxObservedDtu] Gets maximum observed DTU. - * @member {number} [maxObservedStorageMB] Gets maximum observed storage in - * megabytes. - * @member {array} [databases] The list of databases in this pool. Expanded - * property - * @member {array} [metrics] The list of databases housed in the server. - * Expanded property + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual state + * are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', + * 'QueryStoreReadOnly', 'NotSupported' */ -export interface RecommendedElasticPool extends ProxyResource { - readonly databaseEdition?: string; - dtu?: number; - databaseDtuMin?: number; - databaseDtuMax?: number; - storageMB?: number; - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly maxObservedDtu?: number; - readonly maxObservedStorageMB?: number; - readonly databases?: Database[]; - readonly metrics?: RecommendedElasticPoolMetric[]; +export interface AutomaticTuningOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the DatabaseSecurityAlertPolicy class. + * Initializes a new instance of the DatabaseAutomaticTuning class. * @constructor - * Contains information about a database Threat Detection policy. + * Database-level Automatic Tuning. * - * @member {string} [location] The geo-location where the resource lives - * @member {string} [kind] Resource kind. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'New', 'Enabled', 'Disabled' - * @member {string} [disabledAlerts] Specifies the semicolon-separated list of - * alerts that are disabled, or empty string to disable no alerts. Possible - * values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; - * Usage_Anomaly. - * @member {string} [emailAddresses] Specifies the semicolon-separated list of - * e-mail addresses to which the alert is sent. - * @member {string} [emailAccountAdmins] Specifies that the alert is sent to - * the account administrators. Possible values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). This blob storage will hold all - * Threat Detection audit logs. If state is Enabled, storageEndpoint is - * required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the Threat Detection audit storage account. If state is Enabled, - * storageAccountAccessKey is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * Threat Detection audit logs. - * @member {string} [useServerDefault] Specifies whether to use the default - * server policy. Possible values include: 'Enabled', 'Disabled' + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. */ -export interface DatabaseSecurityAlertPolicy extends ProxyResource { - location?: string; - readonly kind?: string; - state: string; - disabledAlerts?: string; - emailAddresses?: string; - emailAccountAdmins?: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - useServerDefault?: string; +export interface DatabaseAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningOptions }; } /** * @class - * Initializes a new instance of the DataMaskingPolicy class. + * Initializes a new instance of the EncryptionProtector class. * @constructor - * Represents a database data masking policy. + * The server encryption protector. * - * @member {string} dataMaskingState The state of the data masking policy. - * Possible values include: 'Disabled', 'Enabled' - * @member {string} [exemptPrincipals] The list of the exempt principals. - * Specifies the semicolon-separated list of database users for which the data - * masking policy does not apply. The specified users receive data results - * without masking for all of the database queries. - * @member {string} [applicationPrincipals] The list of the application - * principals. This is a legacy parameter and is no longer used. - * @member {string} [maskingLevel] The masking level. This is a legacy - * parameter and is no longer used. - * @member {string} [location] The location of the data masking policy. - * @member {string} [kind] The kind of data masking policy. Metadata, used for - * Azure portal. + * @member {string} [kind] Kind of encryption protector. This is metadata used + * for the Azure portal experience. + * @member {string} [location] Resource location. + * @member {string} [subregion] Subregion of the encryption protector. + * @member {string} [serverKeyName] The name of the server key. + * @member {string} serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * @member {string} [uri] The URI of the server key. + * @member {string} [thumbprint] Thumbprint of the server key. */ -export interface DataMaskingPolicy extends ProxyResource { - dataMaskingState: string; - exemptPrincipals?: string; - readonly applicationPrincipals?: string; - readonly maskingLevel?: string; +export interface EncryptionProtector extends ProxyResource { + kind?: string; readonly location?: string; - readonly kind?: string; + readonly subregion?: string; + serverKeyName?: string; + serverKeyType: string; + readonly uri?: string; + readonly thumbprint?: string; } /** * @class - * Initializes a new instance of the DataMaskingRule class. + * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. * @constructor - * Represents a database data masking rule. + * Read-write endpoint of the failover group instance. * - * @member {string} [dataMaskingRuleId] The rule Id. - * @member {string} [aliasName] The alias name. This is a legacy parameter and - * is no longer used. - * @member {string} [ruleState] The rule state. Used to delete a rule. To - * delete an existing rule, specify the schemaName, tableName, columnName, - * maskingFunction, and specify ruleState as disabled. However, if the rule - * doesn't already exist, the rule will be created with ruleState set to - * enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * @member {string} schemaName The schema name on which the data masking rule - * is applied. - * @member {string} tableName The table name on which the data masking rule is - * applied. - * @member {string} columnName The column name on which the data masking rule - * is applied. - * @member {string} maskingFunction The masking function that is used for the - * data masking rule. Possible values include: 'Default', 'CCN', 'Email', - * 'Number', 'SSN', 'Text' - * @member {string} [numberFrom] The numberFrom property of the masking rule. - * Required if maskingFunction is set to Number, otherwise this parameter will - * be ignored. - * @member {string} [numberTo] The numberTo property of the data masking rule. - * Required if maskingFunction is set to Number, otherwise this parameter will - * be ignored. - * @member {string} [prefixSize] If maskingFunction is set to Text, the number - * of characters to show unmasked in the beginning of the string. Otherwise, - * this parameter will be ignored. - * @member {string} [suffixSize] If maskingFunction is set to Text, the number - * of characters to show unmasked at the end of the string. Otherwise, this - * parameter will be ignored. - * @member {string} [replacementString] If maskingFunction is set to Text, the - * character to use for masking the unexposed part of the string. Otherwise, - * this parameter will be ignored. - * @member {string} [location] The location of the data masking rule. - * @member {string} [kind] The kind of Data Masking Rule. Metadata, used for - * Azure portal. + * @member {string} failoverPolicy Failover policy of the read-write endpoint + * for the failover group. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. Possible values include: + * 'Manual', 'Automatic' + * @member {number} [failoverWithDataLossGracePeriodMinutes] Grace period + * before failover with data loss is attempted for the read-write endpoint. If + * failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is + * required. */ -export interface DataMaskingRule extends ProxyResource { - readonly dataMaskingRuleId?: string; - aliasName?: string; - ruleState?: string; - schemaName: string; - tableName: string; - columnName: string; - maskingFunction: string; - numberFrom?: string; - numberTo?: string; - prefixSize?: string; - suffixSize?: string; - replacementString?: string; - readonly location?: string; - readonly kind?: string; +export interface FailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; } /** * @class - * Initializes a new instance of the ElasticPool class. + * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. * @constructor - * Represents a database elastic pool. + * Read-only endpoint of the failover group instance. * - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic pool - * is zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. - * @member {string} [kind] Kind of elastic pool. This is metadata used for the - * Azure portal experience. + * @member {string} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' */ -export interface ElasticPool extends TrackedResource { - readonly creationDate?: Date; - readonly state?: string; - edition?: string; - dtu?: number; - databaseDtuMax?: number; - databaseDtuMin?: number; - storageMB?: number; - zoneRedundant?: boolean; - readonly kind?: string; +export interface FailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; } /** * @class - * Initializes a new instance of the ElasticPoolUpdate class. + * Initializes a new instance of the PartnerInfo class. * @constructor - * Represents an elastic pool update. + * Partner server information for the failover group. * - * @member {object} [tags] Resource tags. - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic pool - * is zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @member {string} id Resource identifier of the partner server. + * @member {string} [location] Geo location of the partner server. + * @member {string} [replicationRole] Replication role of the partner server. + * Possible values include: 'Primary', 'Secondary' */ -export interface ElasticPoolUpdate extends Resource { - tags?: { [propertyName: string]: string }; - readonly creationDate?: Date; - readonly state?: string; - edition?: string; - dtu?: number; - databaseDtuMax?: number; - databaseDtuMin?: number; - storageMB?: number; - zoneRedundant?: boolean; +export interface PartnerInfo { + id: string; + readonly location?: string; + readonly replicationRole?: string; } /** * @class - * Initializes a new instance of the FirewallRule class. + * Initializes a new instance of the FailoverGroup class. * @constructor - * Represents a server firewall rule. + * A failover group. * - * @member {string} [kind] Kind of server that contains this firewall rule. - * @member {string} [location] Location of the server that contains this - * firewall rule. - * @member {string} startIpAddress The start IP address of the firewall rule. - * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP - * addresses. - * @member {string} endIpAddress The end IP address of the firewall rule. Must - * be IPv4 format. Must be greater than or equal to startIpAddress. Use value - * '0.0.0.0' to represent all Azure-internal IP addresses. + * @member {string} [location] Resource location. + * @member {object} [tags] Resource tags. + * @member {object} readWriteEndpoint Read-write endpoint of the failover group + * instance. + * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the + * read-write endpoint for the failover group. If failoverPolicy is Automatic + * then failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] + * Grace period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group + * instance. + * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the + * read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * @member {string} [replicationRole] Local replication role of the failover + * group instance. Possible values include: 'Primary', 'Secondary' + * @member {string} [replicationState] Replication state of the failover group + * instance. + * @member {array} partnerServers List of partner server information for the + * failover group. + * @member {array} [databases] List of databases in the failover group. + */ +export interface FailoverGroup extends ProxyResource { + readonly location?: string; + tags?: { [propertyName: string]: string }; + readWriteEndpoint: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + readonly replicationRole?: string; + readonly replicationState?: string; + partnerServers: PartnerInfo[]; + databases?: string[]; +} + +/** + * @class + * Initializes a new instance of the FailoverGroupUpdate class. + * @constructor + * A failover group update request. + * + * @member {object} [readWriteEndpoint] Read-write endpoint of the failover + * group instance. + * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the + * read-write endpoint for the failover group. If failoverPolicy is Automatic + * then failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] + * Grace period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group + * instance. + * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the + * read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * @member {array} [databases] List of databases in the failover group. + * @member {object} [tags] Resource tags. */ -export interface FirewallRule extends ProxyResource { - readonly kind?: string; - readonly location?: string; - startIpAddress: string; - endIpAddress: string; +export interface FailoverGroupUpdate { + readWriteEndpoint?: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + databases?: string[]; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the GeoBackupPolicy class. + * Initializes a new instance of the OperationDisplay class. * @constructor - * A database geo backup policy. + * Display metadata associated with the operation. * - * @member {string} state The state of the geo backup policy. Possible values - * include: 'Disabled', 'Enabled' - * @member {string} [storageType] The storage type of the geo backup policy. - * @member {string} [kind] Kind of geo backup policy. This is metadata used - * for the Azure portal experience. - * @member {string} [location] Backup policy location. + * @member {string} [provider] The localized friendly form of the resource + * provider name. + * @member {string} [resource] The localized friendly form of the resource type + * related to this action/operation. + * @member {string} [operation] The localized friendly name for the operation. + * @member {string} [description] The localized friendly description for the + * operation. */ -export interface GeoBackupPolicy extends ProxyResource { - state: string; - readonly storageType?: string; - readonly kind?: string; - readonly location?: string; +export interface OperationDisplay { + readonly provider?: string; + readonly resource?: string; + readonly operation?: string; + readonly description?: string; } /** * @class - * Initializes a new instance of the ImportExtensionRequest class. + * Initializes a new instance of the Operation class. * @constructor - * Import database parameters. + * SQL REST API operation definition. * - * @member {string} [name] The name of the extension. - * @member {string} [type] The type of the extension. - * @member {string} storageKeyType The type of the storage key to use. Possible - * values include: 'StorageAccessKey', 'SharedAccessKey' - * @member {string} storageKey The storage key to use. If storage key type is - * SharedAccessKey, it must be preceded with a "?." - * @member {string} storageUri The storage uri to use. - * @member {string} administratorLogin The name of the SQL administrator. - * @member {string} administratorLoginPassword The password of the SQL - * administrator. - * @member {string} [authenticationType] The authentication type. Possible - * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + * @member {string} [name] The name of the operation being performed on this + * particular object. + * @member {object} [display] The localized display information for this + * particular operation / action. + * @member {string} [display.provider] The localized friendly form of the + * resource provider name. + * @member {string} [display.resource] The localized friendly form of the + * resource type related to this action/operation. + * @member {string} [display.operation] The localized friendly name for the + * operation. + * @member {string} [display.description] The localized friendly description + * for the operation. + * @member {string} [origin] The intended executor of the operation. Possible + * values include: 'user', 'system' + * @member {object} [properties] Additional descriptions for the operation. */ -export interface ImportExtensionRequest { - name?: string; - type?: string; - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface Operation { + readonly name?: string; + readonly display?: OperationDisplay; + readonly origin?: string; + readonly properties?: { [propertyName: string]: any }; } /** * @class - * Initializes a new instance of the ImportExportResponse class. + * Initializes a new instance of the ServerKey class. * @constructor - * Response for Import/Export Get operation. + * A server key. * - * @member {string} [requestType] The request type of the operation. - * @member {uuid} [requestId] The request type of the operation. - * @member {string} [serverName] The name of the server. - * @member {string} [databaseName] The name of the database. - * @member {string} [status] The status message returned from the server. - * @member {string} [lastModifiedTime] The operation status last modified time. - * @member {string} [queuedTime] The operation queued time. - * @member {string} [blobUri] The blob uri. - * @member {string} [errorMessage] The error message returned from the server. + * @member {string} [kind] Kind of encryption protector. This is metadata used + * for the Azure portal experience. + * @member {string} [location] Resource location. + * @member {string} [subregion] Subregion of the server key. + * @member {string} serverKeyType The server key type like 'ServiceManaged', + * 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' + * @member {string} [uri] The URI of the server key. + * @member {string} [thumbprint] Thumbprint of the server key. + * @member {date} [creationDate] The server key creation date. */ -export interface ImportExportResponse extends ProxyResource { - readonly requestType?: string; - readonly requestId?: string; - readonly serverName?: string; - readonly databaseName?: string; - readonly status?: string; - readonly lastModifiedTime?: string; - readonly queuedTime?: string; - readonly blobUri?: string; - readonly errorMessage?: string; +export interface ServerKey extends ProxyResource { + kind?: string; + readonly location?: string; + readonly subregion?: string; + serverKeyType: string; + uri?: string; + thumbprint?: string; + creationDate?: Date; } /** * @class - * Initializes a new instance of the ExportRequest class. + * Initializes a new instance of the ResourceIdentity class. * @constructor - * Export database parameters. + * Azure Active Directory identity configuration for a resource. * - * @member {string} storageKeyType The type of the storage key to use. Possible - * values include: 'StorageAccessKey', 'SharedAccessKey' - * @member {string} storageKey The storage key to use. If storage key type is - * SharedAccessKey, it must be preceded with a "?." - * @member {string} storageUri The storage uri to use. - * @member {string} administratorLogin The name of the SQL administrator. - * @member {string} administratorLoginPassword The password of the SQL - * administrator. - * @member {string} [authenticationType] The authentication type. Possible - * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + * @member {uuid} [principalId] The Azure Active Directory principal id. + * @member {string} [type] The identity type. Set this to 'SystemAssigned' in + * order to automatically create and assign an Azure Active Directory principal + * for the resource. Possible values include: 'SystemAssigned' + * @member {uuid} [tenantId] The Azure Active Directory tenant id. */ -export interface ExportRequest { - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface ResourceIdentity { + readonly principalId?: string; + type?: string; + readonly tenantId?: string; } /** * @class - * Initializes a new instance of the ImportRequest class. + * Initializes a new instance of the Server class. * @constructor - * Import database parameters. + * An Azure SQL Database server. * - * @member {string} databaseName The name of the database to import. - * @member {string} edition The edition for the database being created. - * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} serviceObjectiveName The name of the service objective to - * assign to the database. Possible values include: 'System', 'System0', - * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', - * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', - * 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', - * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', - * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', - * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', - * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', - * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} maxSizeBytes The maximum size for the newly imported - * database. + * @member {object} [identity] The Azure Active Directory identity of the + * server. + * @member {uuid} [identity.principalId] The Azure Active Directory principal + * id. + * @member {string} [identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * @member {uuid} [identity.tenantId] The Azure Active Directory tenant id. + * @member {string} [kind] Kind of sql server. This is metadata used for the + * Azure portal experience. + * @member {string} [administratorLogin] Administrator username for the server. + * Once created it cannot be changed. + * @member {string} [administratorLoginPassword] The administrator login + * password (required for server creation). + * @member {string} [version] The version of the server. + * @member {string} [state] The state of the server. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain name + * of the server. */ -export interface ImportRequest extends ExportRequest { - databaseName: string; - edition: string; - serviceObjectiveName: string; - maxSizeBytes: string; +export interface Server extends TrackedResource { + identity?: ResourceIdentity; + readonly kind?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + version?: string; + readonly state?: string; + readonly fullyQualifiedDomainName?: string; } /** * @class - * Initializes a new instance of the MetricValue class. + * Initializes a new instance of the ServerUpdate class. * @constructor - * Represents database metrics. + * An update request for an Azure SQL Database server. * - * @member {number} [count] The number of values for the metric. - * @member {number} [average] The average value of the metric. - * @member {number} [maximum] The max value of the metric. - * @member {number} [minimum] The min value of the metric. - * @member {date} [timestamp] The metric timestamp (ISO-8601 format). - * @member {number} [total] The total value of the metric. + * @member {string} [administratorLogin] Administrator username for the server. + * Once created it cannot be changed. + * @member {string} [administratorLoginPassword] The administrator login + * password (required for server creation). + * @member {string} [version] The version of the server. + * @member {string} [state] The state of the server. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain name + * of the server. + * @member {object} [tags] Resource tags. */ -export interface MetricValue { - readonly count?: number; - readonly average?: number; - readonly maximum?: number; - readonly minimum?: number; - readonly timestamp?: Date; - readonly total?: number; +export interface ServerUpdate { + administratorLogin?: string; + administratorLoginPassword?: string; + version?: string; + readonly state?: string; + readonly fullyQualifiedDomainName?: string; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the MetricName class. + * Initializes a new instance of the SyncAgent class. * @constructor - * A database metric name. + * An Azure SQL Database sync agent. * - * @member {string} [value] The name of the database metric. - * @member {string} [localizedValue] The friendly name of the database metric. + * @member {string} [syncAgentName] Name of the sync agent. + * @member {string} [syncDatabaseId] ARM resource id of the sync database in + * the sync agent. + * @member {date} [lastAliveTime] Last alive time of the sync agent. + * @member {string} [state] State of the sync agent. Possible values include: + * 'Online', 'Offline', 'NeverConnected' + * @member {boolean} [isUpToDate] If the sync agent version is up to date. + * @member {date} [expiryTime] Expiration time of the sync agent version. + * @member {string} [version] Version of the sync agent. */ -export interface MetricName { - readonly value?: string; - readonly localizedValue?: string; +export interface SyncAgent extends ProxyResource { + readonly syncAgentName?: string; + syncDatabaseId?: string; + readonly lastAliveTime?: Date; + readonly state?: string; + readonly isUpToDate?: boolean; + readonly expiryTime?: Date; + readonly version?: string; } /** * @class - * Initializes a new instance of the Metric class. + * Initializes a new instance of the SyncAgentKeyProperties class. * @constructor - * Database metrics. + * Properties of an Azure SQL Database sync agent key. * - * @member {date} [startTime] The start time for the metric (ISO-8601 format). - * @member {date} [endTime] The end time for the metric (ISO-8601 format). - * @member {string} [timeGrain] The time step to be used to summarize the - * metric values. - * @member {string} [unit] The unit of the metric. Possible values include: - * 'count', 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' - * @member {object} [name] The name information for the metric. - * @member {string} [name.value] The name of the database metric. - * @member {string} [name.localizedValue] The friendly name of the database - * metric. - * @member {array} [metricValues] The metric values for the specified time - * window and timestep. + * @member {string} [syncAgentKey] Key of sync agent. */ -export interface Metric { - readonly startTime?: Date; - readonly endTime?: Date; - readonly timeGrain?: string; - readonly unit?: string; - readonly name?: MetricName; - readonly metricValues?: MetricValue[]; +export interface SyncAgentKeyProperties { + readonly syncAgentKey?: string; } /** * @class - * Initializes a new instance of the MetricAvailability class. + * Initializes a new instance of the SyncAgentLinkedDatabase class. * @constructor - * A metric availability value. + * An Azure SQL Database sync agent linked database. * - * @member {string} [retention] The length of retention for the database - * metric. - * @member {string} [timeGrain] The granularity of the database metric. + * @member {string} [databaseType] Type of the sync agent linked database. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @member {string} [databaseId] Id of the sync agent linked database. + * @member {string} [description] Description of the sync agent linked + * database. + * @member {string} [serverName] Server name of the sync agent linked database. + * @member {string} [databaseName] Database name of the sync agent linked + * database. + * @member {string} [userName] User name of the sync agent linked database. */ -export interface MetricAvailability { - readonly retention?: string; - readonly timeGrain?: string; +export interface SyncAgentLinkedDatabase extends ProxyResource { + readonly databaseType?: string; + readonly databaseId?: string; + readonly description?: string; + readonly serverName?: string; + readonly databaseName?: string; + readonly userName?: string; } /** * @class - * Initializes a new instance of the MetricDefinition class. + * Initializes a new instance of the SyncDatabaseIdProperties class. * @constructor - * A database metric definition. + * Properties of the sync database id. * - * @member {object} [name] The name information for the metric. - * @member {string} [name.value] The name of the database metric. - * @member {string} [name.localizedValue] The friendly name of the database - * metric. - * @member {string} [primaryAggregationType] The primary aggregation type - * defining how metric values are displayed. Possible values include: 'None', - * 'Average', 'Count', 'Minimum', 'Maximum', 'Total' - * @member {string} [resourceUri] The resource uri of the database. - * @member {string} [unit] The unit of the metric. Possible values include: - * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - * @member {array} [metricAvailabilities] The list of database metric - * availabities for the metric. + * @member {string} [id] ARM resource id of sync database. */ -export interface MetricDefinition { - readonly name?: MetricName; - readonly primaryAggregationType?: string; - readonly resourceUri?: string; - readonly unit?: string; - readonly metricAvailabilities?: MetricAvailability[]; +export interface SyncDatabaseIdProperties { + readonly id?: string; } /** * @class - * Initializes a new instance of the ReplicationLink class. + * Initializes a new instance of the SyncFullSchemaTableColumn class. * @constructor - * Represents a database replication link. + * Properties of the column in the table of database full schema. * - * @member {string} [location] Location of the server that contains this - * firewall rule. - * @member {boolean} [isTerminationAllowed] Legacy value indicating whether - * termination is allowed. Currently always returns true. - * @member {string} [replicationMode] Replication mode of this replication - * link. - * @member {string} [partnerServer] The name of the server hosting the partner - * database. - * @member {string} [partnerDatabase] The name of the partner database. - * @member {string} [partnerLocation] The Azure Region of the partner database. - * @member {string} [role] The role of the database in the replication link. - * Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', - * 'Source', 'Copy' - * @member {string} [partnerRole] The role of the partner database in the - * replication link. Possible values include: 'Primary', 'Secondary', - * 'NonReadableSecondary', 'Source', 'Copy' - * @member {date} [startTime] The start time for the replication link. - * @member {number} [percentComplete] The percentage of seeding complete for - * the replication link. - * @member {string} [replicationState] The replication state for the - * replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', - * 'SUSPENDED' + * @member {string} [dataSize] Data size of the column. + * @member {string} [dataType] Data type of the column. + * @member {string} [errorId] Error id of the column. + * @member {boolean} [hasError] If there is error in the table. + * @member {boolean} [isPrimaryKey] If it is the primary key of the table. + * @member {string} [name] Name of the column. + * @member {string} [quotedName] Quoted name of the column. */ -export interface ReplicationLink extends ProxyResource { - readonly location?: string; - readonly isTerminationAllowed?: boolean; - readonly replicationMode?: string; - readonly partnerServer?: string; - readonly partnerDatabase?: string; - readonly partnerLocation?: string; - readonly role?: string; - readonly partnerRole?: string; - readonly startTime?: Date; - readonly percentComplete?: number; - readonly replicationState?: string; +export interface SyncFullSchemaTableColumn { + readonly dataSize?: string; + readonly dataType?: string; + readonly errorId?: string; + readonly hasError?: boolean; + readonly isPrimaryKey?: boolean; + readonly name?: string; + readonly quotedName?: string; } /** * @class - * Initializes a new instance of the ServerAzureADAdministrator class. + * Initializes a new instance of the SyncFullSchemaTable class. * @constructor - * An server Active Directory Administrator. + * Properties of the table in the database full schema. * - * @member {string} login The server administrator login value. - * @member {uuid} sid The server administrator Sid (Secure ID). - * @member {uuid} tenantId The server Active Directory Administrator tenant id. + * @member {array} [columns] List of columns in the table of database full + * schema. + * @member {string} [errorId] Error id of the table. + * @member {boolean} [hasError] If there is error in the table. + * @member {string} [name] Name of the table. + * @member {string} [quotedName] Quoted name of the table. */ -export interface ServerAzureADAdministrator extends ProxyResource { - login: string; - sid: string; - tenantId: string; +export interface SyncFullSchemaTable { + readonly columns?: SyncFullSchemaTableColumn[]; + readonly errorId?: string; + readonly hasError?: boolean; + readonly name?: string; + readonly quotedName?: string; } /** * @class - * Initializes a new instance of the ServerCommunicationLink class. + * Initializes a new instance of the SyncFullSchemaProperties class. * @constructor - * Server communication link. + * Properties of the database full schema. * - * @member {string} [state] The state. - * @member {string} partnerServer The name of the partner server. - * @member {string} [location] Communication link location. - * @member {string} [kind] Communication link kind. This property is used for - * Azure Portal metadata. + * @member {array} [tables] List of tables in the database full schema. + * @member {date} [lastUpdateTime] Last update time of the database schema. */ -export interface ServerCommunicationLink extends ProxyResource { - readonly state?: string; - partnerServer: string; - readonly location?: string; - readonly kind?: string; +export interface SyncFullSchemaProperties { + readonly tables?: SyncFullSchemaTable[]; + readonly lastUpdateTime?: Date; } /** * @class - * Initializes a new instance of the ServiceObjective class. + * Initializes a new instance of the SyncGroupLogProperties class. * @constructor - * Represents a database service objective. + * Properties of an Azure SQL Database sync group log. * - * @member {string} [serviceObjectiveName] The name for the service objective. - * @member {boolean} [isDefault] Gets whether the service level objective is - * the default service objective. - * @member {boolean} [isSystem] Gets whether the service level objective is a - * system service objective. - * @member {string} [description] The description for the service level - * objective. - * @member {boolean} [enabled] Gets whether the service level objective is - * enabled. + * @member {date} [timestamp] Timestamp of the sync group log. + * @member {string} [type] Type of the sync group log. Possible values include: + * 'All', 'Error', 'Warning', 'Success' + * @member {string} [source] Source of the sync group log. + * @member {string} [details] Details of the sync group log. + * @member {uuid} [tracingId] TracingId of the sync group log. + * @member {string} [operationStatus] OperationStatus of the sync group log. */ -export interface ServiceObjective extends ProxyResource { - readonly serviceObjectiveName?: string; - readonly isDefault?: boolean; - readonly isSystem?: boolean; - readonly description?: string; - readonly enabled?: boolean; +export interface SyncGroupLogProperties { + readonly timestamp?: Date; + readonly type?: string; + readonly source?: string; + readonly details?: string; + readonly tracingId?: string; + readonly operationStatus?: string; } /** * @class - * Initializes a new instance of the ServerUsage class. + * Initializes a new instance of the SyncGroupSchemaTableColumn class. * @constructor - * Represents server metrics. + * Properties of column in sync group table. * - * @member {string} [name] Name of the server usage metric. - * @member {string} [resourceName] The name of the resource. - * @member {string} [displayName] The metric display name. - * @member {number} [currentValue] The current value of the metric. - * @member {number} [limit] The current limit of the metric. - * @member {string} [unit] The units of the metric. - * @member {date} [nextResetTime] The next reset time for the metric (ISO8601 - * format). - */ -export interface ServerUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; + * @member {string} [quotedName] Quoted name of sync group table column. + * @member {string} [dataSize] Data size of the column. + * @member {string} [dataType] Data type of the column. + */ +export interface SyncGroupSchemaTableColumn { + quotedName?: string; + dataSize?: string; + dataType?: string; } /** * @class - * Initializes a new instance of the DatabaseUsage class. + * Initializes a new instance of the SyncGroupSchemaTable class. * @constructor - * The database usages. + * Properties of table in sync group schema. * - * @member {string} [name] The name of the usage metric. - * @member {string} [resourceName] The name of the resource. - * @member {string} [displayName] The usage metric display name. - * @member {number} [currentValue] The current value of the usage metric. - * @member {number} [limit] The current limit of the usage metric. - * @member {string} [unit] The units of the usage metric. - * @member {date} [nextResetTime] The next reset time for the usage metric - * (ISO8601 format). + * @member {array} [columns] List of columns in sync group schema. + * @member {string} [quotedName] Quoted name of sync group schema table. */ -export interface DatabaseUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; +export interface SyncGroupSchemaTable { + columns?: SyncGroupSchemaTableColumn[]; + quotedName?: string; } /** * @class - * Initializes a new instance of the DatabaseBlobAuditingPolicy class. + * Initializes a new instance of the SyncGroupSchema class. * @constructor - * A database blob auditing policy. + * Properties of sync group schema. * - * @member {string} [kind] Resource kind. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). If state is Enabled, - * storageEndpoint is required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the auditing storage account. If state is Enabled, storageAccountAccessKey - * is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. - * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage - * subscription Id. - * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @member {array} [tables] List of tables in sync group schema. + * @member {string} [masterSyncMemberName] Name of master sync member where the + * schema is from. */ -export interface DatabaseBlobAuditingPolicy extends ProxyResource { - readonly kind?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; +export interface SyncGroupSchema { + tables?: SyncGroupSchemaTable[]; + masterSyncMemberName?: string; } /** * @class - * Initializes a new instance of the AutomaticTuningOptions class. + * Initializes a new instance of the SyncGroup class. * @constructor - * Automatic tuning properties for individual advisors. + * An Azure SQL Database sync group. * - * @member {string} [desiredState] Automatic tuning option desired state. - * Possible values include: 'Off', 'On', 'Default' - * @member {string} [actualState] Automatic tuning option actual state. - * Possible values include: 'Off', 'On' - * @member {number} [reasonCode] Reason code if desired and actual state are - * different. - * @member {string} [reasonDesc] Reason description if desired and actual state - * are different. Possible values include: 'Default', 'Disabled', - * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', - * 'QueryStoreReadOnly', 'NotSupported' + * @member {number} [interval] Sync interval of the sync group. + * @member {date} [lastSyncTime] Last sync time of the sync group. + * @member {string} [conflictResolutionPolicy] Conflict resolution policy of + * the sync group. Possible values include: 'HubWin', 'MemberWin' + * @member {string} [syncDatabaseId] ARM resource id of the sync database in + * the sync group. + * @member {string} [hubDatabaseUserName] User name for the sync group hub + * database credential. + * @member {string} [hubDatabasePassword] Password for the sync group hub + * database credential. + * @member {string} [syncState] Sync state of the sync group. Possible values + * include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good' + * @member {object} [schema] Sync schema of the sync group. + * @member {array} [schema.tables] List of tables in sync group schema. + * @member {string} [schema.masterSyncMemberName] Name of master sync member + * where the schema is from. */ -export interface AutomaticTuningOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: string; +export interface SyncGroup extends ProxyResource { + interval?: number; + readonly lastSyncTime?: Date; + conflictResolutionPolicy?: string; + syncDatabaseId?: string; + hubDatabaseUserName?: string; + hubDatabasePassword?: string; + readonly syncState?: string; + schema?: SyncGroupSchema; } /** * @class - * Initializes a new instance of the DatabaseAutomaticTuning class. + * Initializes a new instance of the SyncMember class. * @constructor - * Database-level Automatic Tuning. + * An Azure SQL Database sync member. * - * @member {string} [desiredState] Automatic tuning desired state. Possible - * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' - * @member {string} [actualState] Automatic tuning actual state. Possible - * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' - * @member {object} [options] Automatic tuning options definition. + * @member {string} [databaseType] Database type of the sync member. Possible + * values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @member {string} [syncAgentId] ARM resource id of the sync agent in the sync + * member. + * @member {uuid} [sqlServerDatabaseId] SQL Server database id of the sync + * member. + * @member {string} [serverName] Server name of the member database in the sync + * member + * @member {string} [databaseName] Database name of the member database in the + * sync member. + * @member {string} [userName] User name of the member database in the sync + * member. + * @member {string} [password] Password of the member database in the sync + * member. + * @member {string} [syncDirection] Sync direction of the sync member. Possible + * values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' + * @member {string} [syncState] Sync state of the sync member. Possible values + * include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', + * 'DisabledTombstoneCleanup', 'DisabledBackupRestore', + * 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', + * 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', + * 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', + * 'ReprovisionFailed', 'UnReprovisioned' */ -export interface DatabaseAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningOptions }; +export interface SyncMember extends ProxyResource { + databaseType?: string; + syncAgentId?: string; + sqlServerDatabaseId?: string; + serverName?: string; + databaseName?: string; + userName?: string; + password?: string; + syncDirection?: string; + readonly syncState?: string; } /** * @class - * Initializes a new instance of the EncryptionProtector class. + * Initializes a new instance of the SubscriptionUsage class. * @constructor - * The server encryption protector. + * Usage Metric of a Subscription in a Location. * - * @member {string} [kind] Kind of encryption protector. This is metadata used - * for the Azure portal experience. - * @member {string} [location] Resource location. - * @member {string} [subregion] Subregion of the encryption protector. - * @member {string} [serverKeyName] The name of the server key. - * @member {string} serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' - * @member {string} [uri] The URI of the server key. - * @member {string} [thumbprint] Thumbprint of the server key. + * @member {string} [displayName] User-readable name of the metric. + * @member {number} [currentValue] Current value of the metric. + * @member {number} [limit] Boundary value of the metric. + * @member {string} [unit] Unit of the metric. */ -export interface EncryptionProtector extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyName?: string; - serverKeyType: string; - readonly uri?: string; - readonly thumbprint?: string; +export interface SubscriptionUsage extends ProxyResource { + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. + * Initializes a new instance of the VirtualNetworkRule class. * @constructor - * Read-write endpoint of the failover group instance. + * A virtual network rule. * - * @member {string} failoverPolicy Failover policy of the read-write endpoint - * for the failover group. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. Possible values include: - * 'Manual', 'Automatic' - * @member {number} [failoverWithDataLossGracePeriodMinutes] Grace period - * before failover with data loss is attempted for the read-write endpoint. If - * failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is - * required. + * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual + * network subnet. + * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule + * before the virtual network has vnet service endpoint enabled. + * @member {string} [state] Virtual Network Rule State. Possible values + * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' */ -export interface FailoverGroupReadWriteEndpoint { - failoverPolicy: string; - failoverWithDataLossGracePeriodMinutes?: number; +export interface VirtualNetworkRule extends ProxyResource { + virtualNetworkSubnetId: string; + ignoreMissingVnetServiceEndpoint?: boolean; + readonly state?: string; } /** * @class - * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. + * Initializes a new instance of the LongTermRetentionBackup class. * @constructor - * Read-only endpoint of the failover group instance. + * A long term retention backup. * - * @member {string} [failoverPolicy] Failover policy of the read-only endpoint - * for the failover group. Possible values include: 'Disabled', 'Enabled' + * @member {string} [serverName] The server name that the backup database + * belong to. + * @member {date} [serverCreateTime] The create time of the server. + * @member {string} [databaseName] The name of the database the backup belong + * to + * @member {date} [databaseDeletionTime] The delete time of the database + * @member {date} [backupTime] The time the backup was taken + * @member {date} [backupExpirationTime] The time the long term retention + * backup will expire. */ -export interface FailoverGroupReadOnlyEndpoint { - failoverPolicy?: string; +export interface LongTermRetentionBackup extends ProxyResource { + readonly serverName?: string; + readonly serverCreateTime?: Date; + readonly databaseName?: string; + readonly databaseDeletionTime?: Date; + readonly backupTime?: Date; + readonly backupExpirationTime?: Date; } /** * @class - * Initializes a new instance of the PartnerInfo class. + * Initializes a new instance of the BackupLongTermRetentionPolicy class. * @constructor - * Partner server information for the failover group. + * A long term retention policy. * - * @member {string} id Resource identifier of the partner server. - * @member {string} [location] Geo location of the partner server. - * @member {string} [replicationRole] Replication role of the partner server. - * Possible values include: 'Primary', 'Secondary' + * @member {string} [weeklyRetention] The weekly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [monthlyRetention] The montly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [yearlyRetention] The yearly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {number} [weekOfYear] The week of year to take the yearly backup in + * an ISO 8601 format. */ -export interface PartnerInfo { - id: string; - readonly location?: string; - readonly replicationRole?: string; +export interface BackupLongTermRetentionPolicy extends ProxyResource { + weeklyRetention?: string; + monthlyRetention?: string; + yearlyRetention?: string; + weekOfYear?: number; } /** * @class - * Initializes a new instance of the FailoverGroup class. + * Initializes a new instance of the AutomaticTuningServerOptions class. * @constructor - * A failover group. + * Automatic tuning properties for individual advisors. * - * @member {string} [location] Resource location. - * @member {object} [tags] Resource tags. - * @member {object} readWriteEndpoint Read-write endpoint of the failover group - * instance. - * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the - * read-write endpoint for the failover group. If failoverPolicy is Automatic - * then failoverWithDataLossGracePeriodMinutes is required. Possible values - * include: 'Manual', 'Automatic' - * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] - * Grace period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group - * instance. - * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the - * read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * @member {string} [replicationRole] Local replication role of the failover - * group instance. Possible values include: 'Primary', 'Secondary' - * @member {string} [replicationState] Replication state of the failover group - * instance. - * @member {array} partnerServers List of partner server information for the - * failover group. - * @member {array} [databases] List of databases in the failover group. + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual state + * are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured' */ -export interface FailoverGroup extends ProxyResource { - readonly location?: string; - tags?: { [propertyName: string]: string }; - readWriteEndpoint: FailoverGroupReadWriteEndpoint; - readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; - readonly replicationRole?: string; - readonly replicationState?: string; - partnerServers: PartnerInfo[]; - databases?: string[]; +export interface AutomaticTuningServerOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the FailoverGroupUpdate class. + * Initializes a new instance of the ServerAutomaticTuning class. * @constructor - * A failover group update request. + * Server-level Automatic Tuning. * - * @member {object} [readWriteEndpoint] Read-write endpoint of the failover - * group instance. - * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the - * read-write endpoint for the failover group. If failoverPolicy is Automatic - * then failoverWithDataLossGracePeriodMinutes is required. Possible values - * include: 'Manual', 'Automatic' - * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] - * Grace period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group - * instance. - * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the - * read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * @member {array} [databases] List of databases in the failover group. - * @member {object} [tags] Resource tags. + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. */ -export interface FailoverGroupUpdate { - readWriteEndpoint?: FailoverGroupReadWriteEndpoint; - readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; - databases?: string[]; - tags?: { [propertyName: string]: string }; +export interface ServerAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningServerOptions }; } /** * @class - * Initializes a new instance of the OperationDisplay class. + * Initializes a new instance of the ServerDnsAlias class. * @constructor - * Display metadata associated with the operation. + * A server DNS alias. * - * @member {string} [provider] The localized friendly form of the resource - * provider name. - * @member {string} [resource] The localized friendly form of the resource type - * related to this action/operation. - * @member {string} [operation] The localized friendly name for the operation. - * @member {string} [description] The localized friendly description for the - * operation. + * @member {string} [azureDnsRecord] The fully qualified DNS record for alias */ -export interface OperationDisplay { - readonly provider?: string; - readonly resource?: string; - readonly operation?: string; - readonly description?: string; +export interface ServerDnsAlias extends ProxyResource { + readonly azureDnsRecord?: string; } /** * @class - * Initializes a new instance of the Operation class. + * Initializes a new instance of the ServerDnsAliasAcquisition class. * @constructor - * SQL REST API operation definition. + * A server DNS alias acquisition request. * - * @member {string} [name] The name of the operation being performed on this - * particular object. - * @member {object} [display] The localized display information for this - * particular operation / action. - * @member {string} [display.provider] The localized friendly form of the - * resource provider name. - * @member {string} [display.resource] The localized friendly form of the - * resource type related to this action/operation. - * @member {string} [display.operation] The localized friendly name for the - * operation. - * @member {string} [display.description] The localized friendly description - * for the operation. - * @member {string} [origin] The intended executor of the operation. Possible - * values include: 'user', 'system' - * @member {object} [properties] Additional descriptions for the operation. + * @member {string} [oldServerDnsAliasId] The id of the server alias that will + * be acquired to point to this server instead. */ -export interface Operation { - readonly name?: string; - readonly display?: OperationDisplay; - readonly origin?: string; - readonly properties?: { [propertyName: string]: any }; +export interface ServerDnsAliasAcquisition { + oldServerDnsAliasId?: string; } /** * @class - * Initializes a new instance of the ServerKey class. + * Initializes a new instance of the RestorePoint class. * @constructor - * A server key. + * Database restore points. * - * @member {string} [kind] Kind of encryption protector. This is metadata used - * for the Azure portal experience. * @member {string} [location] Resource location. - * @member {string} [subregion] Subregion of the server key. - * @member {string} serverKeyType The server key type like 'ServiceManaged', - * 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' - * @member {string} [uri] The URI of the server key. - * @member {string} [thumbprint] Thumbprint of the server key. - * @member {date} [creationDate] The server key creation date. + * @member {string} [restorePointType] The type of restore point. Possible + * values include: 'CONTINUOUS', 'DISCRETE' + * @member {date} [earliestRestoreDate] The earliest time to which this + * database can be restored + * @member {date} [restorePointCreationDate] The time the backup was taken + * @member {string} [restorePointLabel] The label of restore point for backup + * request by user */ -export interface ServerKey extends ProxyResource { - kind?: string; +export interface RestorePoint extends ProxyResource { readonly location?: string; - readonly subregion?: string; - serverKeyType: string; - uri?: string; - thumbprint?: string; - creationDate?: Date; -} - -/** - * @class - * Initializes a new instance of the ResourceIdentity class. - * @constructor - * Azure Active Directory identity configuration for a resource. - * - * @member {uuid} [principalId] The Azure Active Directory principal id. - * @member {string} [type] The identity type. Set this to 'SystemAssigned' in - * order to automatically create and assign an Azure Active Directory principal - * for the resource. Possible values include: 'SystemAssigned' - * @member {uuid} [tenantId] The Azure Active Directory tenant id. - */ -export interface ResourceIdentity { - readonly principalId?: string; - type?: string; - readonly tenantId?: string; + readonly restorePointType?: string; + readonly earliestRestoreDate?: Date; + readonly restorePointCreationDate?: Date; + readonly restorePointLabel?: string; } /** * @class - * Initializes a new instance of the Server class. + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. * @constructor - * An Azure SQL Database server. + * Contains the information necessary to perform a create database restore + * point operation. * - * @member {object} [identity] The Azure Active Directory identity of the - * server. - * @member {uuid} [identity.principalId] The Azure Active Directory principal - * id. - * @member {string} [identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * @member {uuid} [identity.tenantId] The Azure Active Directory tenant id. - * @member {string} [kind] Kind of sql server. This is metadata used for the - * Azure portal experience. - * @member {string} [administratorLogin] Administrator username for the server. - * Once created it cannot be changed. - * @member {string} [administratorLoginPassword] The administrator login - * password (required for server creation). - * @member {string} [version] The version of the server. - * @member {string} [state] The state of the server. - * @member {string} [fullyQualifiedDomainName] The fully qualified domain name - * of the server. + * @member {string} restorePointLabel The restore point label to apply */ -export interface Server extends TrackedResource { - identity?: ResourceIdentity; - readonly kind?: string; - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: string; +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; } /** * @class - * Initializes a new instance of the ServerUpdate class. + * Initializes a new instance of the DatabaseOperation class. * @constructor - * An update request for an Azure SQL Database server. + * A database operation. * - * @member {string} [administratorLogin] Administrator username for the server. - * Once created it cannot be changed. - * @member {string} [administratorLoginPassword] The administrator login - * password (required for server creation). - * @member {string} [version] The version of the server. - * @member {string} [state] The state of the server. - * @member {string} [fullyQualifiedDomainName] The fully qualified domain name - * of the server. - * @member {object} [tags] Resource tags. + * @member {string} [databaseName] The name of the database the operation is + * being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. Possible values include: + * 'Pending', 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', + * 'Cancelled' + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ -export interface ServerUpdate { - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; +export interface DatabaseOperation extends ProxyResource { + readonly databaseName?: string; + readonly operation?: string; + readonly operationFriendlyName?: string; + readonly percentComplete?: number; + readonly serverName?: string; + readonly startTime?: Date; readonly state?: string; - readonly fullyQualifiedDomainName?: string; - tags?: { [propertyName: string]: string }; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; } /** * @class - * Initializes a new instance of the SyncAgent class. + * Initializes a new instance of the ElasticPoolOperation class. * @constructor - * An Azure SQL Database sync agent. + * A elastic pool operation. * - * @member {string} [syncAgentName] Name of the sync agent. - * @member {string} [syncDatabaseId] ARM resource id of the sync database in - * the sync agent. - * @member {date} [lastAliveTime] Last alive time of the sync agent. - * @member {string} [state] State of the sync agent. Possible values include: - * 'Online', 'Offline', 'NeverConnected' - * @member {boolean} [isUpToDate] If the sync agent version is up to date. - * @member {date} [expiryTime] Expiration time of the sync agent version. - * @member {string} [version] Version of the sync agent. + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ -export interface SyncAgent extends ProxyResource { - readonly syncAgentName?: string; - syncDatabaseId?: string; - readonly lastAliveTime?: Date; +export interface ElasticPoolOperation extends ProxyResource { + readonly elasticPoolName?: string; + readonly operation?: string; + readonly operationFriendlyName?: string; + readonly percentComplete?: number; + readonly serverName?: string; + readonly startTime?: Date; readonly state?: string; - readonly isUpToDate?: boolean; - readonly expiryTime?: Date; - readonly version?: string; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; } /** * @class - * Initializes a new instance of the SyncAgentKeyProperties class. + * Initializes a new instance of the MaxSizeCapability class. * @constructor - * Properties of an Azure SQL Database sync agent key. + * The maximum size capability. * - * @member {string} [syncAgentKey] Key of sync agent. + * @member {number} [limit] The maximum size limit (see 'unit' for the units). + * @member {string} [unit] The units that the limit is expressed in. Possible + * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' */ -export interface SyncAgentKeyProperties { - readonly syncAgentKey?: string; +export interface MaxSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncAgentLinkedDatabase class. + * Initializes a new instance of the LogSizeCapability class. * @constructor - * An Azure SQL Database sync agent linked database. + * The log size capability. * - * @member {string} [databaseType] Type of the sync agent linked database. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * @member {string} [databaseId] Id of the sync agent linked database. - * @member {string} [description] Description of the sync agent linked - * database. - * @member {string} [serverName] Server name of the sync agent linked database. - * @member {string} [databaseName] Database name of the sync agent linked - * database. - * @member {string} [userName] User name of the sync agent linked database. + * @member {number} [limit] The log size limit (see 'unit' for the units). + * @member {string} [unit] The units that the limit is expressed in. Possible + * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', + * 'Percent' */ -export interface SyncAgentLinkedDatabase extends ProxyResource { - readonly databaseType?: string; - readonly databaseId?: string; - readonly description?: string; - readonly serverName?: string; - readonly databaseName?: string; - readonly userName?: string; +export interface LogSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncDatabaseIdProperties class. + * Initializes a new instance of the MaxSizeRangeCapability class. * @constructor - * Properties of the sync database id. + * The maximum size range capability. * - * @member {string} [id] ARM resource id of sync database. + * @member {object} [minValue] Minimum value. + * @member {number} [minValue.limit] The maximum size limit (see 'unit' for the + * units). + * @member {string} [minValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' + * @member {object} [maxValue] Maximum value. + * @member {number} [maxValue.limit] The maximum size limit (see 'unit' for the + * units). + * @member {string} [maxValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' + * @member {object} [scaleSize] Scale/step size for discrete values between the + * minimum value and the maximum value. + * @member {number} [scaleSize.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [scaleSize.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' + * @member {object} [logSize] Size of transaction log. + * @member {number} [logSize.limit] The log size limit (see 'unit' for the + * units). + * @member {string} [logSize.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', + * 'Percent' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncDatabaseIdProperties { - readonly id?: string; +export interface MaxSizeRangeCapability { + readonly minValue?: MaxSizeCapability; + readonly maxValue?: MaxSizeCapability; + readonly scaleSize?: MaxSizeCapability; + readonly logSize?: LogSizeCapability; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaTableColumn class. + * Initializes a new instance of the PerformanceLevelCapability class. * @constructor - * Properties of the column in the table of database full schema. + * The performance level capability. * - * @member {string} [dataSize] Data size of the column. - * @member {string} [dataType] Data type of the column. - * @member {string} [errorId] Error id of the column. - * @member {boolean} [hasError] If there is error in the table. - * @member {boolean} [isPrimaryKey] If it is the primary key of the table. - * @member {string} [name] Name of the column. - * @member {string} [quotedName] Quoted name of the column. + * @member {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' */ -export interface SyncFullSchemaTableColumn { - readonly dataSize?: string; - readonly dataType?: string; - readonly errorId?: string; - readonly hasError?: boolean; - readonly isPrimaryKey?: boolean; - readonly name?: string; - readonly quotedName?: string; +export interface PerformanceLevelCapability { + readonly value?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaTable class. + * Initializes a new instance of the Sku class. * @constructor - * Properties of the table in the database full schema. + * An ARM Resource SKU. * - * @member {array} [columns] List of columns in the table of database full - * schema. - * @member {string} [errorId] Error id of the table. - * @member {boolean} [hasError] If there is error in the table. - * @member {string} [name] Name of the table. - * @member {string} [quotedName] Quoted name of the table. + * @member {string} name The name of the SKU, typically, a letter + Number + * code, e.g. P3. + * @member {string} [tier] The tier of the particular SKU, e.g. Basic, Premium. + * @member {string} [size] Size of the particular SKU + * @member {string} [family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [capacity] Capacity of the particular SKU. */ -export interface SyncFullSchemaTable { - readonly columns?: SyncFullSchemaTableColumn[]; - readonly errorId?: string; - readonly hasError?: boolean; - readonly name?: string; - readonly quotedName?: string; +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; } /** * @class - * Initializes a new instance of the SyncFullSchemaProperties class. + * Initializes a new instance of the LicenseTypeCapability class. * @constructor - * Properties of the database full schema. + * The license type capability * - * @member {array} [tables] List of tables in the database full schema. - * @member {date} [lastUpdateTime] Last update time of the database schema. + * @member {string} [name] License type identifier. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncFullSchemaProperties { - readonly tables?: SyncFullSchemaTable[]; - readonly lastUpdateTime?: Date; +export interface LicenseTypeCapability { + readonly name?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupLogProperties class. + * Initializes a new instance of the ServiceObjectiveCapability class. * @constructor - * Properties of an Azure SQL Database sync group log. + * The service objectives capability. * - * @member {date} [timestamp] Timestamp of the sync group log. - * @member {string} [type] Type of the sync group log. Possible values include: - * 'All', 'Error', 'Warning', 'Success' - * @member {string} [source] Source of the sync group log. - * @member {string} [details] Details of the sync group log. - * @member {uuid} [tracingId] TracingId of the sync group log. - * @member {string} [operationStatus] OperationStatus of the sync group log. + * @member {uuid} [id] The unique ID of the service objective. + * @member {string} [name] The service objective name. + * @member {array} [supportedMaxSizes] The list of supported maximum database + * sizes. + * @member {object} [performanceLevel] The performance level. + * @member {number} [performanceLevel.value] Performance level value. + * @member {string} [performanceLevel.unit] Unit type used to measure + * performance level. Possible values include: 'DTU', 'VCores' + * @member {object} [sku] The sku. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {object} [includedMaxSize] The included (free) max size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see 'unit' + * for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncGroupLogProperties { - readonly timestamp?: Date; - readonly type?: string; - readonly source?: string; - readonly details?: string; - readonly tracingId?: string; - readonly operationStatus?: string; +export interface ServiceObjectiveCapability { + readonly id?: string; + readonly name?: string; + readonly supportedMaxSizes?: MaxSizeRangeCapability[]; + readonly performanceLevel?: PerformanceLevelCapability; + readonly sku?: Sku; + readonly supportedLicenseTypes?: LicenseTypeCapability[]; + readonly includedMaxSize?: MaxSizeCapability; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTableColumn class. + * Initializes a new instance of the EditionCapability class. * @constructor - * Properties of column in sync group table. + * The edition capability. * - * @member {string} [quotedName] Quoted name of sync group table column. - * @member {string} [dataSize] Data size of the column. - * @member {string} [dataType] Data type of the column. + * @member {string} [name] The database edition name. + * @member {array} [supportedServiceLevelObjectives] The list of supported + * service objectives for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncGroupSchemaTableColumn { - quotedName?: string; - dataSize?: string; - dataType?: string; +export interface EditionCapability { + readonly name?: string; + readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTable class. + * Initializes a new instance of the ElasticPoolPerDatabaseMinPerformanceLevelCapability class. * @constructor - * Properties of table in sync group schema. + * The minimum per-database performance level capability. * - * @member {array} [columns] List of columns in sync group schema. - * @member {string} [quotedName] Quoted name of sync group schema table. + * @member {number} [limit] The minimum performance level per database. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncGroupSchemaTable { - columns?: SyncGroupSchemaTableColumn[]; - quotedName?: string; +export interface ElasticPoolPerDatabaseMinPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchema class. + * Initializes a new instance of the ElasticPoolPerDatabaseMaxPerformanceLevelCapability class. * @constructor - * Properties of sync group schema. + * The max per-database performance level capability. * - * @member {array} [tables] List of tables in sync group schema. - * @member {string} [masterSyncMemberName] Name of master sync member where the - * schema is from. + * @member {number} [limit] The maximum performance level per database. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + * @member {array} [supportedPerDatabaseMinPerformanceLevels] The list of + * supported min database performance levels. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncGroupSchema { - tables?: SyncGroupSchemaTable[]; - masterSyncMemberName?: string; +export interface ElasticPoolPerDatabaseMaxPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly supportedPerDatabaseMinPerformanceLevels?: ElasticPoolPerDatabaseMinPerformanceLevelCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroup class. + * Initializes a new instance of the ElasticPoolPerformanceLevelCapability class. * @constructor - * An Azure SQL Database sync group. - * - * @member {number} [interval] Sync interval of the sync group. - * @member {date} [lastSyncTime] Last sync time of the sync group. - * @member {string} [conflictResolutionPolicy] Conflict resolution policy of - * the sync group. Possible values include: 'HubWin', 'MemberWin' - * @member {string} [syncDatabaseId] ARM resource id of the sync database in - * the sync group. - * @member {string} [hubDatabaseUserName] User name for the sync group hub - * database credential. - * @member {string} [hubDatabasePassword] Password for the sync group hub - * database credential. - * @member {string} [syncState] Sync state of the sync group. Possible values - * include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good' - * @member {object} [schema] Sync schema of the sync group. - * @member {array} [schema.tables] List of tables in sync group schema. - * @member {string} [schema.masterSyncMemberName] Name of master sync member - * where the schema is from. + * The Elastic Pool performance level capability. + * + * @member {object} [performanceLevel] The performance level for the pool. + * @member {number} [performanceLevel.value] Performance level value. + * @member {string} [performanceLevel.unit] Unit type used to measure + * performance level. Possible values include: 'DTU', 'VCores' + * @member {object} [sku] The sku. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {number} [maxDatabaseCount] The maximum number of databases + * supported. + * @member {object} [includedMaxSize] The included (free) max size for this + * performance level. + * @member {number} [includedMaxSize.limit] The maximum size limit (see 'unit' + * for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {array} [supportedMaxSizes] The list of supported max sizes. + * @member {array} [supportedPerDatabaseMaxSizes] The list of supported per + * database max sizes. + * @member {array} [supportedPerDatabaseMaxPerformanceLevels] The list of + * supported per database max performance levels. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncGroup extends ProxyResource { - interval?: number; - readonly lastSyncTime?: Date; - conflictResolutionPolicy?: string; - syncDatabaseId?: string; - hubDatabaseUserName?: string; - hubDatabasePassword?: string; - readonly syncState?: string; - schema?: SyncGroupSchema; +export interface ElasticPoolPerformanceLevelCapability { + readonly performanceLevel?: PerformanceLevelCapability; + readonly sku?: Sku; + readonly supportedLicenseTypes?: LicenseTypeCapability[]; + readonly maxDatabaseCount?: number; + readonly includedMaxSize?: MaxSizeCapability; + readonly supportedMaxSizes?: MaxSizeRangeCapability[]; + readonly supportedPerDatabaseMaxSizes?: MaxSizeRangeCapability[]; + readonly supportedPerDatabaseMaxPerformanceLevels?: ElasticPoolPerDatabaseMaxPerformanceLevelCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncMember class. + * Initializes a new instance of the ElasticPoolEditionCapability class. * @constructor - * An Azure SQL Database sync member. + * The elastic pool edition capability. * - * @member {string} [databaseType] Database type of the sync member. Possible - * values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * @member {string} [syncAgentId] ARM resource id of the sync agent in the sync - * member. - * @member {uuid} [sqlServerDatabaseId] SQL Server database id of the sync - * member. - * @member {string} [serverName] Server name of the member database in the sync - * member - * @member {string} [databaseName] Database name of the member database in the - * sync member. - * @member {string} [userName] User name of the member database in the sync - * member. - * @member {string} [password] Password of the member database in the sync - * member. - * @member {string} [syncDirection] Sync direction of the sync member. Possible - * values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' - * @member {string} [syncState] Sync state of the sync member. Possible values - * include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', - * 'DisabledTombstoneCleanup', 'DisabledBackupRestore', - * 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', - * 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', - * 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', - * 'ReprovisionFailed', 'UnReprovisioned' + * @member {string} [name] The elastic pool edition name. + * @member {array} [supportedElasticPoolPerformanceLevels] The list of + * supported elastic pool DTU levels for the edition. + * @member {boolean} [zoneRedundant] Whether or not zone redundancy is + * supported for the edition. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SyncMember extends ProxyResource { - databaseType?: string; - syncAgentId?: string; - sqlServerDatabaseId?: string; - serverName?: string; - databaseName?: string; - userName?: string; - password?: string; - syncDirection?: string; - readonly syncState?: string; +export interface ElasticPoolEditionCapability { + readonly name?: string; + readonly supportedElasticPoolPerformanceLevels?: ElasticPoolPerformanceLevelCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SubscriptionUsage class. + * Initializes a new instance of the ServerVersionCapability class. * @constructor - * Usage Metric of a Subscription in a Location. + * The server capability * - * @member {string} [displayName] User-readable name of the metric. - * @member {number} [currentValue] Current value of the metric. - * @member {number} [limit] Boundary value of the metric. - * @member {string} [unit] Unit of the metric. + * @member {string} [name] The server version name. + * @member {array} [supportedEditions] The list of supported database editions. + * @member {array} [supportedElasticPoolEditions] The list of supported elastic + * pool editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface SubscriptionUsage extends ProxyResource { - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; +export interface ServerVersionCapability { + readonly name?: string; + readonly supportedEditions?: EditionCapability[]; + readonly supportedElasticPoolEditions?: ElasticPoolEditionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the VirtualNetworkRule class. + * Initializes a new instance of the ManagedInstanceVcoresCapability class. * @constructor - * A virtual network rule. + * The managed instance virtual cores capability. * - * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual - * network subnet. - * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. - * @member {string} [state] Virtual Network Rule State. Possible values - * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + * @member {string} [name] The virtual cores identifier. + * @member {number} [value] The virtual cores value. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface VirtualNetworkRule extends ProxyResource { - virtualNetworkSubnetId: string; - ignoreMissingVnetServiceEndpoint?: boolean; - readonly state?: string; +export interface ManagedInstanceVcoresCapability { + readonly name?: string; + readonly value?: number; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the LongTermRetentionBackup class. + * Initializes a new instance of the ManagedInstanceFamilyCapability class. * @constructor - * A long term retention backup. + * The managed server family capability. * - * @member {string} [serverName] The server name that the backup database - * belong to. - * @member {date} [serverCreateTime] The create time of the server. - * @member {string} [databaseName] The name of the database the backup belong - * to - * @member {date} [databaseDeletionTime] The delete time of the database - * @member {date} [backupTime] The time the backup was taken - * @member {date} [backupExpirationTime] The time the long term retention - * backup will expire. + * @member {string} [name] Family name. + * @member {string} [sku] SKU name. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {array} [supportedVcoresValues] List of supported virtual cores + * values. + * @member {object} [includedMaxSize] Included size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see 'unit' + * for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {array} [supportedStorageSizes] Storage size ranges. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface LongTermRetentionBackup extends ProxyResource { - readonly serverName?: string; - readonly serverCreateTime?: Date; - readonly databaseName?: string; - readonly databaseDeletionTime?: Date; - readonly backupTime?: Date; - readonly backupExpirationTime?: Date; +export interface ManagedInstanceFamilyCapability { + readonly name?: string; + readonly sku?: string; + readonly supportedLicenseTypes?: LicenseTypeCapability[]; + readonly supportedVcoresValues?: ManagedInstanceVcoresCapability[]; + readonly includedMaxSize?: MaxSizeCapability; + readonly supportedStorageSizes?: MaxSizeRangeCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the BackupLongTermRetentionPolicy class. + * Initializes a new instance of the ManagedInstanceEditionCapability class. * @constructor - * A long term retention policy. + * The managed server capability * - * @member {string} [weeklyRetention] The weekly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {string} [monthlyRetention] The montly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {string} [yearlyRetention] The yearly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {number} [weekOfYear] The week of year to take the yearly backup in - * an ISO 8601 format. + * @member {string} [name] The managed server version name. + * @member {array} [supportedFamilies] The supported families. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface BackupLongTermRetentionPolicy extends ProxyResource { - weeklyRetention?: string; - monthlyRetention?: string; - yearlyRetention?: string; - weekOfYear?: number; +export interface ManagedInstanceEditionCapability { + readonly name?: string; + readonly supportedFamilies?: ManagedInstanceFamilyCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ResourceMoveDefinition class. + * Initializes a new instance of the ManagedInstanceVersionCapability class. * @constructor - * Contains the information necessary to perform a resource move (rename). + * The managed instance capability * - * @member {string} id The target ID for the resource + * @member {string} [name] The server version name. + * @member {array} [supportedEditions] The list of supported managed instance + * editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface ResourceMoveDefinition { - id: string; +export interface ManagedInstanceVersionCapability { + readonly name?: string; + readonly supportedEditions?: ManagedInstanceEditionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the AutomaticTuningServerOptions class. + * Initializes a new instance of the LocationCapabilities class. * @constructor - * Automatic tuning properties for individual advisors. + * The location capability. * - * @member {string} [desiredState] Automatic tuning option desired state. - * Possible values include: 'Off', 'On', 'Default' - * @member {string} [actualState] Automatic tuning option actual state. - * Possible values include: 'Off', 'On' - * @member {number} [reasonCode] Reason code if desired and actual state are - * different. - * @member {string} [reasonDesc] Reason description if desired and actual state - * are different. Possible values include: 'Default', 'Disabled', - * 'AutoConfigured' + * @member {string} [name] The location name. + * @member {array} [supportedServerVersions] The list of supported server + * versions. + * @member {array} [supportedManagedInstanceVersions] The list of supported + * managed instance versions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being available. */ -export interface AutomaticTuningServerOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: string; +export interface LocationCapabilities { + readonly name?: string; + readonly supportedServerVersions?: ServerVersionCapability[]; + readonly supportedManagedInstanceVersions?: ManagedInstanceVersionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ServerAutomaticTuning class. + * Initializes a new instance of the Database class. * @constructor - * Server-level Automatic Tuning. + * A database resource. + * + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of database. This is metadata used for the + * Azure portal experience. + * @member {string} [managedBy] Resource that manages the database. + * @member {string} [createMode] Specifies the mode of database creation. * - * @member {string} [desiredState] Automatic tuning desired state. Possible - * values include: 'Custom', 'Auto', 'Unspecified' - * @member {string} [actualState] Automatic tuning actual state. Possible - * values include: 'Custom', 'Auto', 'Unspecified' - * @member {object} [options] Automatic tuning options definition. + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * @member {string} [collation] The collation of the database. + * @member {number} [maxSizeBytes] The max size of the database expressed in + * bytes. + * @member {string} [sampleName] The name of the sample schema to apply when + * creating this database. Possible values include: 'AdventureWorksLT', + * 'WideWorldImportersStd', 'WideWorldImportersFull' + * @member {string} [elasticPoolId] The resource identifier of the elastic pool + * containing this database. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [status] 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' + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {string} [currentServiceObjectiveName] The current service level + * objective name of the database. + * @member {string} [requestedServiceObjectiveName] The requested service level + * objective name of the database. + * @member {string} [defaultSecondaryLocation] The default secondary region for + * this database. + * @member {string} [failoverGroupId] Failover Group resource identifier that + * this database belongs to. + * @member {date} [restorePointInTime] Specifies the point in time (ISO8601 + * format) of the source database that will be restored to create the new + * database. + * @member {date} [sourceDatabaseDeletionDate] Specifies the time that the + * database was deleted. + * @member {string} [recoveryServicesRecoveryPointId] The resource identifier + * of the recovery point associated with create operation of this database. + * @member {string} [longTermRetentionBackupResourceId] The resource identifier + * of the long term retention backup associated with create operation of this + * database. + * @member {string} [recoverableDatabaseId] The resource identifier of the + * recoverable database associated with create operation of this database. + * @member {string} [restorableDroppedDatabaseId] The resource identifier of + * the restorable dropped database associated with create operation of this + * database. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. + * @member {string} [licenseType] The license type to apply for this database. + * Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {number} [maxLogSizeBytes] The max log size for this database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [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' + * @member {object} [currentSku] The name and tier of the SKU. + * @member {string} [currentSku.name] The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * @member {string} [currentSku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * @member {string} [currentSku.size] Size of the particular SKU + * @member {string} [currentSku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * @member {number} [currentSku.capacity] Capacity of the particular SKU. */ -export interface ServerAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningServerOptions }; +export interface Database extends TrackedResource { + sku?: Sku; + readonly kind?: string; + readonly managedBy?: string; + createMode?: string; + collation?: string; + maxSizeBytes?: number; + sampleName?: string; + elasticPoolId?: string; + sourceDatabaseId?: string; + readonly status?: string; + readonly databaseId?: string; + readonly creationDate?: Date; + readonly currentServiceObjectiveName?: string; + readonly requestedServiceObjectiveName?: string; + readonly defaultSecondaryLocation?: string; + readonly failoverGroupId?: string; + restorePointInTime?: Date; + sourceDatabaseDeletionDate?: Date; + recoveryServicesRecoveryPointId?: string; + longTermRetentionBackupResourceId?: string; + recoverableDatabaseId?: string; + restorableDroppedDatabaseId?: string; + catalogCollation?: string; + zoneRedundant?: boolean; + licenseType?: string; + readonly maxLogSizeBytes?: number; + readonly earliestRestoreDate?: Date; + readScale?: string; + readonly currentSku?: Sku; } /** * @class - * Initializes a new instance of the ServerDnsAlias class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * A server DNS alias. + * A database resource. + * + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [createMode] Specifies the mode of database creation. * - * @member {string} [azureDnsRecord] The fully qualified DNS record for alias - */ -export interface ServerDnsAlias extends ProxyResource { - readonly azureDnsRecord?: string; -} - -/** - * @class - * Initializes a new instance of the ServerDnsAliasAcquisition class. - * @constructor - * A server DNS alias acquisition request. + * Default: regular database creation. * - * @member {string} [oldServerDnsAliasId] The id of the server alias that will - * be acquired to point to this server instead. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * @member {string} [collation] The collation of the database. + * @member {number} [maxSizeBytes] The max size of the database expressed in + * bytes. + * @member {string} [sampleName] The name of the sample schema to apply when + * creating this database. Possible values include: 'AdventureWorksLT', + * 'WideWorldImportersStd', 'WideWorldImportersFull' + * @member {string} [elasticPoolId] The resource identifier of the elastic pool + * containing this database. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [status] 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' + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {string} [currentServiceObjectiveName] The current service level + * objective name of the database. + * @member {string} [requestedServiceObjectiveName] The requested service level + * objective name of the database. + * @member {string} [defaultSecondaryLocation] The default secondary region for + * this database. + * @member {string} [failoverGroupId] Failover Group resource identifier that + * this database belongs to. + * @member {date} [restorePointInTime] Specifies the point in time (ISO8601 + * format) of the source database that will be restored to create the new + * database. + * @member {date} [sourceDatabaseDeletionDate] Specifies the time that the + * database was deleted. + * @member {string} [recoveryServicesRecoveryPointId] The resource identifier + * of the recovery point associated with create operation of this database. + * @member {string} [longTermRetentionBackupResourceId] The resource identifier + * of the long term retention backup associated with create operation of this + * database. + * @member {string} [recoverableDatabaseId] The resource identifier of the + * recoverable database associated with create operation of this database. + * @member {string} [restorableDroppedDatabaseId] The resource identifier of + * the restorable dropped database associated with create operation of this + * database. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. + * @member {string} [licenseType] The license type to apply for this database. + * Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {number} [maxLogSizeBytes] The max log size for this database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [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' + * @member {object} [currentSku] The name and tier of the SKU. + * @member {string} [currentSku.name] The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * @member {string} [currentSku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * @member {string} [currentSku.size] Size of the particular SKU + * @member {string} [currentSku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * @member {number} [currentSku.capacity] Capacity of the particular SKU. + * @member {object} [tags] Resource tags. */ -export interface ServerDnsAliasAcquisition { - oldServerDnsAliasId?: string; +export interface DatabaseUpdate { + sku?: Sku; + createMode?: string; + collation?: string; + maxSizeBytes?: number; + sampleName?: string; + elasticPoolId?: string; + sourceDatabaseId?: string; + readonly status?: string; + readonly databaseId?: string; + readonly creationDate?: Date; + readonly currentServiceObjectiveName?: string; + readonly requestedServiceObjectiveName?: string; + readonly defaultSecondaryLocation?: string; + readonly failoverGroupId?: string; + restorePointInTime?: Date; + sourceDatabaseDeletionDate?: Date; + recoveryServicesRecoveryPointId?: string; + longTermRetentionBackupResourceId?: string; + recoverableDatabaseId?: string; + restorableDroppedDatabaseId?: string; + catalogCollation?: string; + zoneRedundant?: boolean; + licenseType?: string; + readonly maxLogSizeBytes?: number; + readonly earliestRestoreDate?: Date; + readScale?: string; + readonly currentSku?: Sku; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the RestorePoint class. + * Initializes a new instance of the ResourceMoveDefinition class. * @constructor - * Database restore points. + * Contains the information necessary to perform a resource move (rename). * - * @member {string} [location] Resource location. - * @member {string} [restorePointType] The type of restore point. Possible - * values include: 'CONTINUOUS', 'DISCRETE' - * @member {date} [earliestRestoreDate] The earliest time to which this - * database can be restored - * @member {date} [restorePointCreationDate] The time the backup was taken - * @member {string} [restorePointLabel] The label of restore point for backup - * request by user + * @member {string} id The target ID for the resource */ -export interface RestorePoint extends ProxyResource { - readonly location?: string; - readonly restorePointType?: string; - readonly earliestRestoreDate?: Date; - readonly restorePointCreationDate?: Date; - readonly restorePointLabel?: string; +export interface ResourceMoveDefinition { + id: string; } /** * @class - * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. + * Initializes a new instance of the ElasticPoolPerDatabaseSettings class. * @constructor - * Contains the information necessary to perform a create database restore - * point operation. + * Per database settings of an elastic pool. * - * @member {string} restorePointLabel The restore point label to apply + * @member {number} [minCapacity] The minimum capacity all databases are + * guaranteed. + * @member {number} [maxCapacity] The maximum capacity any one database can + * consume. */ -export interface CreateDatabaseRestorePointDefinition { - restorePointLabel: string; +export interface ElasticPoolPerDatabaseSettings { + minCapacity?: number; + maxCapacity?: number; } /** * @class - * Initializes a new instance of the DatabaseOperation class. + * Initializes a new instance of the ElasticPool class. * @constructor - * A database operation. - * - * @member {string} [databaseName] The name of the database the operation is - * being performed on. - * @member {string} [operation] The name of operation. - * @member {string} [operationFriendlyName] The friendly name of operation. - * @member {number} [percentComplete] The percentage of the operation - * completed. - * @member {string} [serverName] The name of the server. - * @member {date} [startTime] The operation start time. - * @member {string} [state] The operation state. Possible values include: - * 'Pending', 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', - * 'Cancelled' - * @member {number} [errorCode] The operation error code. - * @member {string} [errorDescription] The operation error description. - * @member {number} [errorSeverity] The operation error severity. - * @member {boolean} [isUserError] Whether or not the error is a user error. - * @member {date} [estimatedCompletionTime] The estimated completion time of - * the operation. - * @member {string} [description] The operation description. - * @member {boolean} [isCancellable] Whether the operation can be cancelled. + * An elastic pool. + * + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of elastic pool. This is metadata used for the + * Azure portal experience. + * @member {string} [state] The state of the elastic pool. Possible values + * include: 'Creating', 'Ready', 'Disabled' + * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * format). + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity all + * databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity any + * one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' */ -export interface DatabaseOperation extends ProxyResource { - readonly databaseName?: string; - readonly operation?: string; - readonly operationFriendlyName?: string; - readonly percentComplete?: number; - readonly serverName?: string; - readonly startTime?: Date; +export interface ElasticPool extends TrackedResource { + sku?: Sku; + readonly kind?: string; readonly state?: string; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; + readonly creationDate?: Date; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; } /** * @class - * Initializes a new instance of the ElasticPoolOperation class. + * Initializes a new instance of the ElasticPoolUpdate class. * @constructor - * A elastic pool operation. - * - * @member {string} [elasticPoolName] The name of the elastic pool the - * operation is being performed on. - * @member {string} [operation] The name of operation. - * @member {string} [operationFriendlyName] The friendly name of operation. - * @member {number} [percentComplete] The percentage of the operation - * completed. - * @member {string} [serverName] The name of the server. - * @member {date} [startTime] The operation start time. - * @member {string} [state] The operation state. - * @member {number} [errorCode] The operation error code. - * @member {string} [errorDescription] The operation error description. - * @member {number} [errorSeverity] The operation error severity. - * @member {boolean} [isUserError] Whether or not the error is a user error. - * @member {date} [estimatedCompletionTime] The estimated completion time of - * the operation. - * @member {string} [description] The operation description. - * @member {boolean} [isCancellable] Whether the operation can be cancelled. + * An elastic pool update. + * + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity all + * databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity any + * one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {object} [tags] Resource tags. */ -export interface ElasticPoolOperation extends ProxyResource { - readonly elasticPoolName?: string; - readonly operation?: string; - readonly operationFriendlyName?: string; - readonly percentComplete?: number; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; +export interface ElasticPoolUpdate { + sku?: Sku; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; + tags?: { [propertyName: string]: string }; } @@ -2688,12 +2888,32 @@ export interface ServerListResult extends Array { /** * @class - * Initializes a new instance of the DatabaseListResult class. + * Initializes a new instance of the DataMaskingRuleListResult class. * @constructor - * Represents the response to a list database request. + * The response to a list data masking rules request. * */ -export interface DatabaseListResult extends Array { +export interface DataMaskingRuleListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the FirewallRuleListResult class. + * @constructor + * Represents the response to a List Firewall Rules request. + * + */ +export interface FirewallRuleListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the GeoBackupPolicyListResult class. + * @constructor + * The response to a list geo backup policies request. + * + */ +export interface GeoBackupPolicyListResult extends Array { } /** @@ -2718,42 +2938,46 @@ export interface MetricDefinitionListResult extends Array { /** * @class - * Initializes a new instance of the DataMaskingRuleListResult class. + * Initializes a new instance of the DatabaseListResult class. * @constructor - * The response to a list data masking rules request. + * A list of databases. * + * @member {string} [nextLink] Link to retrieve next page of results. */ -export interface DataMaskingRuleListResult extends Array { +export interface DatabaseListResult extends Array { + readonly nextLink?: string; } /** * @class * Initializes a new instance of the ElasticPoolListResult class. * @constructor - * Represents the response to a list elastic pool request. + * The result of an elastic pool list request. * + * @member {string} [nextLink] Link to retrieve next page of results. */ export interface ElasticPoolListResult extends Array { + readonly nextLink?: string; } /** * @class - * Initializes a new instance of the FirewallRuleListResult class. + * Initializes a new instance of the RecommendedElasticPoolListResult class. * @constructor - * Represents the response to a List Firewall Rules request. + * Represents the response to a list recommended elastic pool request. * */ -export interface FirewallRuleListResult extends Array { +export interface RecommendedElasticPoolListResult extends Array { } /** * @class - * Initializes a new instance of the GeoBackupPolicyListResult class. + * Initializes a new instance of the RecommendedElasticPoolListMetricsResult class. * @constructor - * The response to a list geo backup policies request. + * Represents the response to a list recommended elastic pool metrics request. * */ -export interface GeoBackupPolicyListResult extends Array { +export interface RecommendedElasticPoolListMetricsResult extends Array { } /** @@ -2816,26 +3040,6 @@ export interface ElasticPoolActivityListResult extends Array { } -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListResult class. - * @constructor - * Represents the response to a list recommended elastic pool request. - * - */ -export interface RecommendedElasticPoolListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListMetricsResult class. - * @constructor - * Represents the response to a list recommended elastic pool metrics request. - * - */ -export interface RecommendedElasticPoolListMetricsResult extends Array { -} - /** * @class * Initializes a new instance of the ServiceTierAdvisorListResult class. diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 936e303e18..eb58f54c80 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -23,35 +23,12 @@ exports.TrackedResource = require('./trackedResource'); exports.ProxyResource = require('./proxyResource'); exports.RecoverableDatabase = require('./recoverableDatabase'); exports.RestorableDroppedDatabase = require('./restorableDroppedDatabase'); -exports.MaxSizeCapability = require('./maxSizeCapability'); -exports.ServiceObjectiveCapability = require('./serviceObjectiveCapability'); -exports.EditionCapability = require('./editionCapability'); -exports.ElasticPoolPerDatabaseMinDtuCapability = require('./elasticPoolPerDatabaseMinDtuCapability'); -exports.ElasticPoolPerDatabaseMaxDtuCapability = require('./elasticPoolPerDatabaseMaxDtuCapability'); -exports.ElasticPoolDtuCapability = require('./elasticPoolDtuCapability'); -exports.ElasticPoolEditionCapability = require('./elasticPoolEditionCapability'); -exports.ServerVersionCapability = require('./serverVersionCapability'); -exports.LocationCapabilities = require('./locationCapabilities'); exports.CheckNameAvailabilityRequest = require('./checkNameAvailabilityRequest'); exports.CheckNameAvailabilityResponse = require('./checkNameAvailabilityResponse'); exports.ServerConnectionPolicy = require('./serverConnectionPolicy'); -exports.SloUsageMetric = require('./sloUsageMetric'); -exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); -exports.TransparentDataEncryption = require('./transparentDataEncryption'); -exports.OperationImpact = require('./operationImpact'); -exports.RecommendedIndex = require('./recommendedIndex'); -exports.Database = require('./database'); -exports.DatabaseUpdate = require('./databaseUpdate'); -exports.TransparentDataEncryptionActivity = require('./transparentDataEncryptionActivity'); -exports.ElasticPoolDatabaseActivity = require('./elasticPoolDatabaseActivity'); -exports.ElasticPoolActivity = require('./elasticPoolActivity'); -exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); -exports.RecommendedElasticPool = require('./recommendedElasticPool'); exports.DatabaseSecurityAlertPolicy = require('./databaseSecurityAlertPolicy'); exports.DataMaskingPolicy = require('./dataMaskingPolicy'); exports.DataMaskingRule = require('./dataMaskingRule'); -exports.ElasticPool = require('./elasticPool'); -exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); exports.FirewallRule = require('./firewallRule'); exports.GeoBackupPolicy = require('./geoBackupPolicy'); exports.ImportExtensionRequest = require('./importExtensionRequest'); @@ -63,10 +40,20 @@ exports.MetricName = require('./metricName'); exports.Metric = require('./metric'); exports.MetricAvailability = require('./metricAvailability'); exports.MetricDefinition = require('./metricDefinition'); +exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); +exports.RecommendedElasticPool = require('./recommendedElasticPool'); exports.ReplicationLink = require('./replicationLink'); exports.ServerAzureADAdministrator = require('./serverAzureADAdministrator'); exports.ServerCommunicationLink = require('./serverCommunicationLink'); exports.ServiceObjective = require('./serviceObjective'); +exports.ElasticPoolActivity = require('./elasticPoolActivity'); +exports.ElasticPoolDatabaseActivity = require('./elasticPoolDatabaseActivity'); +exports.OperationImpact = require('./operationImpact'); +exports.RecommendedIndex = require('./recommendedIndex'); +exports.TransparentDataEncryption = require('./transparentDataEncryption'); +exports.SloUsageMetric = require('./sloUsageMetric'); +exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); +exports.TransparentDataEncryptionActivity = require('./transparentDataEncryptionActivity'); exports.ServerUsage = require('./serverUsage'); exports.DatabaseUsage = require('./databaseUsage'); exports.DatabaseBlobAuditingPolicy = require('./databaseBlobAuditingPolicy'); @@ -101,7 +88,6 @@ exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); exports.LongTermRetentionBackup = require('./longTermRetentionBackup'); exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); -exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions'); exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); exports.ServerDnsAlias = require('./serverDnsAlias'); @@ -110,24 +96,48 @@ exports.RestorePoint = require('./restorePoint'); exports.CreateDatabaseRestorePointDefinition = require('./createDatabaseRestorePointDefinition'); exports.DatabaseOperation = require('./databaseOperation'); exports.ElasticPoolOperation = require('./elasticPoolOperation'); +exports.MaxSizeCapability = require('./maxSizeCapability'); +exports.LogSizeCapability = require('./logSizeCapability'); +exports.MaxSizeRangeCapability = require('./maxSizeRangeCapability'); +exports.PerformanceLevelCapability = require('./performanceLevelCapability'); +exports.Sku = require('./sku'); +exports.LicenseTypeCapability = require('./licenseTypeCapability'); +exports.ServiceObjectiveCapability = require('./serviceObjectiveCapability'); +exports.EditionCapability = require('./editionCapability'); +exports.ElasticPoolPerDatabaseMinPerformanceLevelCapability = require('./elasticPoolPerDatabaseMinPerformanceLevelCapability'); +exports.ElasticPoolPerDatabaseMaxPerformanceLevelCapability = require('./elasticPoolPerDatabaseMaxPerformanceLevelCapability'); +exports.ElasticPoolPerformanceLevelCapability = require('./elasticPoolPerformanceLevelCapability'); +exports.ElasticPoolEditionCapability = require('./elasticPoolEditionCapability'); +exports.ServerVersionCapability = require('./serverVersionCapability'); +exports.ManagedInstanceVcoresCapability = require('./managedInstanceVcoresCapability'); +exports.ManagedInstanceFamilyCapability = require('./managedInstanceFamilyCapability'); +exports.ManagedInstanceEditionCapability = require('./managedInstanceEditionCapability'); +exports.ManagedInstanceVersionCapability = require('./managedInstanceVersionCapability'); +exports.LocationCapabilities = require('./locationCapabilities'); +exports.Database = require('./database'); +exports.DatabaseUpdate = require('./databaseUpdate'); +exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); +exports.ElasticPoolPerDatabaseSettings = require('./elasticPoolPerDatabaseSettings'); +exports.ElasticPool = require('./elasticPool'); +exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); exports.ServerListResult = require('./serverListResult'); -exports.DatabaseListResult = require('./databaseListResult'); -exports.MetricListResult = require('./metricListResult'); -exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); exports.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); -exports.ElasticPoolListResult = require('./elasticPoolListResult'); exports.FirewallRuleListResult = require('./firewallRuleListResult'); exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); +exports.MetricListResult = require('./metricListResult'); +exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); +exports.DatabaseListResult = require('./databaseListResult'); +exports.ElasticPoolListResult = require('./elasticPoolListResult'); +exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); +exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ReplicationLinkListResult = require('./replicationLinkListResult'); exports.ServerAdministratorListResult = require('./serverAdministratorListResult'); exports.ServerCommunicationLinkListResult = require('./serverCommunicationLinkListResult'); exports.ServiceObjectiveListResult = require('./serviceObjectiveListResult'); exports.ElasticPoolActivityListResult = require('./elasticPoolActivityListResult'); exports.ElasticPoolDatabaseActivityListResult = require('./elasticPoolDatabaseActivityListResult'); -exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); -exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ServiceTierAdvisorListResult = require('./serviceTierAdvisorListResult'); exports.TransparentDataEncryptionActivityListResult = require('./transparentDataEncryptionActivityListResult'); exports.ServerUsageListResult = require('./serverUsageListResult'); diff --git a/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js b/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js new file mode 100644 index 0000000000..7149b0c6b8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js @@ -0,0 +1,73 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The license type capability + * + */ +class LicenseTypeCapability { + /** + * Create a LicenseTypeCapability. + * @member {string} [name] License type identifier. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of LicenseTypeCapability + * + * @returns {object} metadata of LicenseTypeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'LicenseTypeCapability', + type: { + name: 'Composite', + className: 'LicenseTypeCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LicenseTypeCapability; diff --git a/lib/services/sqlManagement2/lib/models/locationCapabilities.js b/lib/services/sqlManagement2/lib/models/locationCapabilities.js index 4b7e537941..0f72b83c59 100644 --- a/lib/services/sqlManagement2/lib/models/locationCapabilities.js +++ b/lib/services/sqlManagement2/lib/models/locationCapabilities.js @@ -13,17 +13,21 @@ const models = require('./index'); /** - * The capabilities for a location. + * The location capability. * */ class LocationCapabilities { /** * Create a LocationCapabilities. * @member {string} [name] The location name. - * @member {string} [status] Azure SQL Database's status for the location. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedServerVersions] The list of supported server * versions. + * @member {array} [supportedManagedInstanceVersions] The list of supported + * managed instance versions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -50,30 +54,53 @@ class LocationCapabilities { name: 'String' } }, - status: { + supportedServerVersions: { required: false, readOnly: true, - serializedName: 'status', + serializedName: 'supportedServerVersions', type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'Sequence', + element: { + required: false, + serializedName: 'ServerVersionCapabilityElementType', + type: { + name: 'Composite', + className: 'ServerVersionCapability' + } + } } }, - supportedServerVersions: { + supportedManagedInstanceVersions: { required: false, readOnly: true, - serializedName: 'supportedServerVersions', + serializedName: 'supportedManagedInstanceVersions', type: { name: 'Sequence', element: { required: false, - serializedName: 'ServerVersionCapabilityElementType', + serializedName: 'ManagedInstanceVersionCapabilityElementType', type: { name: 'Composite', - className: 'ServerVersionCapability' + className: 'ManagedInstanceVersionCapability' } } } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/logSizeCapability.js b/lib/services/sqlManagement2/lib/models/logSizeCapability.js new file mode 100644 index 0000000000..939f3898f1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/logSizeCapability.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The log size capability. + * + */ +class LogSizeCapability { + /** + * Create a LogSizeCapability. + * @member {number} [limit] The log size limit (see 'unit' for the units). + * @member {string} [unit] The units that the limit is expressed in. Possible + * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', + * 'Percent' + */ + constructor() { + } + + /** + * Defines the metadata of LogSizeCapability + * + * @returns {object} metadata of LogSizeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'LogSizeCapability', + type: { + name: 'Composite', + className: 'LogSizeCapability', + modelProperties: { + limit: { + required: false, + readOnly: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogSizeCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js new file mode 100644 index 0000000000..c117ce2d74 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js @@ -0,0 +1,92 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed server capability + * + */ +class ManagedInstanceEditionCapability { + /** + * Create a ManagedInstanceEditionCapability. + * @member {string} [name] The managed server version name. + * @member {array} [supportedFamilies] The supported families. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceEditionCapability + * + * @returns {object} metadata of ManagedInstanceEditionCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceEditionCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceEditionCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + supportedFamilies: { + required: false, + readOnly: true, + serializedName: 'supportedFamilies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceFamilyCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceFamilyCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceEditionCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js new file mode 100644 index 0000000000..1ef2e7e779 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js @@ -0,0 +1,151 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed server family capability. + * + */ +class ManagedInstanceFamilyCapability { + /** + * Create a ManagedInstanceFamilyCapability. + * @member {string} [name] Family name. + * @member {string} [sku] SKU name. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {array} [supportedVcoresValues] List of supported virtual cores + * values. + * @member {object} [includedMaxSize] Included size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see + * 'unit' for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {array} [supportedStorageSizes] Storage size ranges. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceFamilyCapability + * + * @returns {object} metadata of ManagedInstanceFamilyCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceFamilyCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceFamilyCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'String' + } + }, + supportedLicenseTypes: { + required: false, + readOnly: true, + serializedName: 'supportedLicenseTypes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LicenseTypeCapabilityElementType', + type: { + name: 'Composite', + className: 'LicenseTypeCapability' + } + } + } + }, + supportedVcoresValues: { + required: false, + readOnly: true, + serializedName: 'supportedVcoresValues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceVcoresCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceVcoresCapability' + } + } + } + }, + includedMaxSize: { + required: false, + readOnly: true, + serializedName: 'includedMaxSize', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + supportedStorageSizes: { + required: false, + readOnly: true, + serializedName: 'supportedStorageSizes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceFamilyCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js new file mode 100644 index 0000000000..2bed9e08d7 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js @@ -0,0 +1,82 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The managed instance virtual cores capability. + * + */ +class ManagedInstanceVcoresCapability { + /** + * Create a ManagedInstanceVcoresCapability. + * @member {string} [name] The virtual cores identifier. + * @member {number} [value] The virtual cores value. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceVcoresCapability + * + * @returns {object} metadata of ManagedInstanceVcoresCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceVcoresCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceVcoresCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Number' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceVcoresCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js new file mode 100644 index 0000000000..8cd7cdf2e5 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js @@ -0,0 +1,93 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed instance capability + * + */ +class ManagedInstanceVersionCapability { + /** + * Create a ManagedInstanceVersionCapability. + * @member {string} [name] The server version name. + * @member {array} [supportedEditions] The list of supported managed instance + * editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceVersionCapability + * + * @returns {object} metadata of ManagedInstanceVersionCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceVersionCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceVersionCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + supportedEditions: { + required: false, + readOnly: true, + serializedName: 'supportedEditions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceEditionCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceEditionCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceVersionCapability; diff --git a/lib/services/sqlManagement2/lib/models/maxSizeCapability.js b/lib/services/sqlManagement2/lib/models/maxSizeCapability.js index 04a717e819..14fe8dc472 100644 --- a/lib/services/sqlManagement2/lib/models/maxSizeCapability.js +++ b/lib/services/sqlManagement2/lib/models/maxSizeCapability.js @@ -11,18 +11,16 @@ 'use strict'; /** - * The maximum size limits for a database. + * The maximum size capability. * */ class MaxSizeCapability { /** * Create a MaxSizeCapability. - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). + * @member {number} [limit] The maximum size limit (see 'unit' for the + * units). * @member {string} [unit] The units that the limit is expressed in. Possible * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' - * @member {string} [status] The status of the maximum size capability. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' */ constructor() { } @@ -54,17 +52,7 @@ class MaxSizeCapability { readOnly: true, serializedName: 'unit', type: { - name: 'Enum', - allowedValues: [ 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' ] - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'String' } } } diff --git a/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js b/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js new file mode 100644 index 0000000000..b5f5a10131 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js @@ -0,0 +1,127 @@ +/* + * 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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The maximum size range capability. + * + */ +class MaxSizeRangeCapability { + /** + * Create a MaxSizeRangeCapability. + * @member {object} [minValue] Minimum value. + * @member {number} [minValue.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [minValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [maxValue] Maximum value. + * @member {number} [maxValue.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [maxValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [scaleSize] Scale/step size for discrete values between + * the minimum value and the maximum value. + * @member {number} [scaleSize.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [scaleSize.unit] The units that the limit is expressed + * in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [logSize] Size of transaction log. + * @member {number} [logSize.limit] The log size limit (see 'unit' for the + * units). + * @member {string} [logSize.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes', 'Percent' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of MaxSizeRangeCapability + * + * @returns {object} metadata of MaxSizeRangeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'MaxSizeRangeCapability', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability', + modelProperties: { + minValue: { + required: false, + readOnly: true, + serializedName: 'minValue', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + maxValue: { + required: false, + readOnly: true, + serializedName: 'maxValue', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + scaleSize: { + required: false, + readOnly: true, + serializedName: 'scaleSize', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + logSize: { + required: false, + readOnly: true, + serializedName: 'logSize', + type: { + name: 'Composite', + className: 'LogSizeCapability' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MaxSizeRangeCapability; diff --git a/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js b/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js new file mode 100644 index 0000000000..236196e0d3 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js @@ -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. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The performance level capability. + * + */ +class PerformanceLevelCapability { + /** + * Create a PerformanceLevelCapability. + * @member {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + */ + constructor() { + } + + /** + * Defines the metadata of PerformanceLevelCapability + * + * @returns {object} metadata of PerformanceLevelCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'PerformanceLevelCapability', + type: { + name: 'Composite', + className: 'PerformanceLevelCapability', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PerformanceLevelCapability; diff --git a/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js b/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js index 1a55e0d85e..dd8c75d9c7 100644 --- a/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js +++ b/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js @@ -157,10 +157,10 @@ class RecommendedElasticPool extends models['ProxyResource'] { name: 'Sequence', element: { required: false, - serializedName: 'DatabaseElementType', + serializedName: 'TrackedResourceElementType', type: { name: 'Composite', - className: 'Database' + className: 'TrackedResource' } } } diff --git a/lib/services/sqlManagement2/lib/models/serverVersionCapability.js b/lib/services/sqlManagement2/lib/models/serverVersionCapability.js index add9a6e39a..aa369f80bb 100644 --- a/lib/services/sqlManagement2/lib/models/serverVersionCapability.js +++ b/lib/services/sqlManagement2/lib/models/serverVersionCapability.js @@ -13,19 +13,21 @@ const models = require('./index'); /** - * The server capabilities. + * The server capability * */ class ServerVersionCapability { /** * Create a ServerVersionCapability. * @member {string} [name] The server version name. - * @member {string} [status] The status of the server version. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedEditions] The list of supported database * editions. * @member {array} [supportedElasticPoolEditions] The list of supported * elastic pool editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -52,15 +54,6 @@ class ServerVersionCapability { name: 'String' } }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] - } - }, supportedEditions: { required: false, readOnly: true, @@ -92,6 +85,22 @@ class ServerVersionCapability { } } } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js b/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js index f700e2a0ab..0b9970c1e5 100644 --- a/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js +++ b/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js @@ -19,25 +19,34 @@ const models = require('./index'); class ServiceObjectiveCapability { /** * Create a ServiceObjectiveCapability. - * @member {string} [name] The service objective name. - * @member {string} [status] The status of the service objective. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {string} [unit] Unit type used to measure service objective - * performance level. Possible values include: 'DTU' - * @member {number} [value] Performance level value. * @member {uuid} [id] The unique ID of the service objective. + * @member {string} [name] The service objective name. * @member {array} [supportedMaxSizes] The list of supported maximum database - * sizes for this service objective. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). + * sizes. + * @member {object} [performanceLevel] The performance level. + * @member {number} [performanceLevel.value] Performance level value. + * @member {string} [performanceLevel.unit] Unit type used to measure + * performance level. Possible values include: 'DTU', 'VCores' + * @member {object} [sku] The sku. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {object} [includedMaxSize] The included (free) max size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see + * 'unit' for the units). * @member {string} [includedMaxSize.unit] The units that the limit is * expressed in. Possible values include: 'Megabytes', 'Gigabytes', * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -56,60 +65,68 @@ class ServiceObjectiveCapability { name: 'Composite', className: 'ServiceObjectiveCapability', modelProperties: { - name: { + id: { required: false, readOnly: true, - serializedName: 'name', + serializedName: 'id', type: { name: 'String' } }, - status: { + name: { required: false, readOnly: true, - serializedName: 'status', + serializedName: 'name', type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'String' } }, - unit: { + supportedMaxSizes: { required: false, readOnly: true, - serializedName: 'performanceLevel.unit', + serializedName: 'supportedMaxSizes', type: { - name: 'Enum', - allowedValues: [ 'DTU' ] + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } } }, - value: { + performanceLevel: { required: false, readOnly: true, - serializedName: 'performanceLevel.value', + serializedName: 'performanceLevel', type: { - name: 'Number' + name: 'Composite', + className: 'PerformanceLevelCapability' } }, - id: { + sku: { required: false, readOnly: true, - serializedName: 'id', + serializedName: 'sku', type: { - name: 'String' + name: 'Composite', + className: 'Sku' } }, - supportedMaxSizes: { + supportedLicenseTypes: { required: false, readOnly: true, - serializedName: 'supportedMaxSizes', + serializedName: 'supportedLicenseTypes', type: { name: 'Sequence', element: { required: false, - serializedName: 'MaxSizeCapabilityElementType', + serializedName: 'LicenseTypeCapabilityElementType', type: { name: 'Composite', - className: 'MaxSizeCapability' + className: 'LicenseTypeCapability' } } } @@ -122,6 +139,22 @@ class ServiceObjectiveCapability { name: 'Composite', className: 'MaxSizeCapability' } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/sku.js b/lib/services/sqlManagement2/lib/models/sku.js new file mode 100644 index 0000000000..698c630dff --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/sku.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An ARM Resource SKU. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} name The name of the SKU, typically, a letter + Number + * code, e.g. P3. + * @member {string} [tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [size] Size of the particular SKU + * @member {string} [family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [capacity] Capacity of the particular SKU. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/sqlManagement2/lib/operations/capabilities.js b/lib/services/sqlManagement2/lib/operations/capabilities.js index cd8f64438f..86da4bf0e9 100644 --- a/lib/services/sqlManagement2/lib/operations/capabilities.js +++ b/lib/services/sqlManagement2/lib/operations/capabilities.js @@ -15,12 +15,18 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -37,7 +43,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByLocation(locationId, options, callback) { +function _listByLocation(locationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47,15 +53,19 @@ function _listByLocation(locationId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let include = (options && options.include !== undefined) ? options.include : undefined; + let apiVersion = '2017-10-01-preview'; // Validate try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (include !== null && include !== undefined && typeof include.valueOf() !== 'string') { + throw new Error('include must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (locationId === null || locationId === undefined || typeof locationId.valueOf() !== 'string') { - throw new Error('locationId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,10 +75,13 @@ function _listByLocation(locationId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{locationId}', encodeURIComponent(locationId)); let queryParameters = []; + if (include !== null && include !== undefined) { + queryParameters.push('include=' + encodeURIComponent(include)); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -163,12 +176,18 @@ class Capabilities { } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -178,11 +197,11 @@ class Capabilities { * * @reject {Error} - The error object. */ - listByLocationWithHttpOperationResponse(locationId, options) { + listByLocationWithHttpOperationResponse(locationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByLocation(locationId, options, (err, result, request, response) => { + self._listByLocation(locationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -193,12 +212,18 @@ class Capabilities { } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -224,7 +249,7 @@ class Capabilities { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByLocation(locationId, options, optionalCallback) { + listByLocation(locationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -233,14 +258,14 @@ class Capabilities { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByLocation(locationId, options, (err, result, request, response) => { + self._listByLocation(locationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByLocation(locationId, options, optionalCallback); + return self._listByLocation(locationName, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index 7e2d2ea7df..7febf21ad9 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -16,7 +16,7 @@ const WebResource = msRest.WebResource; /** - * Pauses a data warehouse. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -24,74 +24,47 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. - * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.databaseName The name of the database to import. * - * @param {function} callback - The callback. + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * - * @returns {function} callback(err, result, request, response) + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _pause(resourceGroupName, serverName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Resumes a data warehouse. + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} 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 {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} serverName The name of the server. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -104,13 +77,14 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resume(resourceGroupName, serverName, databaseName, options, callback) { +function _importMethod(resourceGroupName, serverName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -123,7 +97,7 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) } // Send request - this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -142,6 +116,20 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) if (responseBody === '') responseBody = null; // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } return callback(null, result, httpRequest, response); }); @@ -150,7 +138,8 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) /** - * Creates a new database or updates an existing database. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -158,146 +147,31 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} databaseName The name of the database to import into * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} [parameters.name] The name of the extension. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} [parameters.type] The type of the extension. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -311,13 +185,13 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -330,7 +204,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -354,7 +228,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -371,7 +245,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters /** - * Updates an existing database. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -379,142 +253,26 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} databaseName The name of the database to be exported. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} parameters The required parameters for exporting a database. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -528,13 +286,13 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -547,7 +305,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option } // Send request - this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -571,7 +329,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -587,7 +345,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option } /** - * Deletes a database. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -595,7 +353,10 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -608,13 +369,14 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { +function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -639,6 +401,9 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -648,20 +413,21 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -686,7 +452,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -714,13 +480,30 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MetricListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets a database. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -728,14 +511,10 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -746,13 +525,14 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -762,7 +542,6 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; let apiVersion = '2014-04-01'; // Validate try { @@ -778,9 +557,6 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -790,16 +566,13 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -866,7 +639,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -881,8 +654,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { }); } + /** - * Returns a list of databases in a server. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -890,14 +664,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} databaseName The name of the database to be upgraded. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -908,147 +677,52 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByServer(resourceGroupName, serverName, options, callback) { +function _upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1056,11 +730,6 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1073,13 +742,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1089,23 +758,17 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1116,12 +779,10 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1190,7 +851,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['DatabaseListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1206,7 +867,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab } /** - * Returns a list of databases in an elastic pool. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1214,8 +875,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1229,13 +889,13 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _get(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1245,20 +905,20 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1269,11 +929,11 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1342,7 +1002,7 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1357,8 +1017,9 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti }); } + /** - * Gets a database inside of a recommented elastic pool. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1366,135 +1027,170 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @param {string} databaseName The name of the database. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The requested database resource state. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {function} callback - The callback. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @returns {function} callback(err, result, request, response) + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); + if (!callback) { + throw new Error('callback cannot be null.'); } - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1509,14 +1205,15 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Returns a list of databases inside a recommented elastic pool. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1524,8 +1221,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1538,138 +1234,53 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, callback) { +function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); } /** - * Imports a bacpac into a new database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1677,154 +1288,117 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.databaseName The name of the database to import. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Default: regular database creation. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {object} [options] Optional Parameters. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {function} callback - The callback. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @returns {function} callback(err, result, request, response) + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * {Error} err - The Error object if an error occurred, null otherwise. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.collation] The collation of the database. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _importMethod(resourceGroupName, serverName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} 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 {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {string} serverName The name of the server. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} databaseName The name of the database to import into + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.name] The name of the extension. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.type] The type of the extension. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1838,13 +1412,13 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1857,7 +1431,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par } // Send request - this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -1881,7 +1455,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1896,9 +1470,8 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par }); } - /** - * Exports a database to a bacpac. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1906,26 +1479,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1939,141 +1493,53 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } - - // Send request - this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Returns database metrics. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2140,7 +1606,7 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); + let resultMapper = new client.models['DatabaseListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2155,8 +1621,9 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio }); } + /** - * Returns database metric definitions. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2164,7 +1631,7 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -2178,121 +1645,50 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { +function _pause(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2301,14 +1697,15 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Renames a database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2316,12 +1713,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to rename. - * - * @param {object} parameters The resource move definition for renaming this - * database. - * - * @param {string} parameters.id The target ID for the resource + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -2334,37 +1726,123 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _resume(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } + + // Send request + this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Renames a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2463,7 +1941,7 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option } /** - * Pauses a data warehouse. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2471,7 +1949,47 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2484,13 +2002,14 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { +function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2512,8 +2031,8 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -2524,11 +2043,10 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2555,7 +2073,21 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImportRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -2590,13 +2122,31 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2604,7 +2154,31 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2617,13 +2191,14 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { +function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2634,6 +2209,11 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call throw new Error('callback cannot be null.'); } let apiVersion = '2014-04-01'; + let extensionName = 'import'; + if (parameters === null || parameters === undefined) + { + parameters = {}; + } // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2648,6 +2228,9 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2657,11 +2240,12 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2670,7 +2254,7 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2688,14 +2272,28 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2723,160 +2321,57 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates a new database or updates an existing database. - * + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Exports a database to a bacpac. + * * @param {string} 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 {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} databaseName The name of the database to be exported. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2890,13 +2385,13 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2933,7 +2428,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -2946,7 +2441,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2969,7 +2464,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['Database']().mapper(); + let requestModelMapper = new client.models['ExportRequest']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -2985,7 +2480,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3020,7 +2515,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3030,30 +2525,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); } /** - * Updates an existing database. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3061,142 +2539,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3209,14 +2552,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3226,12 +2568,9 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3241,8 +2580,8 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3253,11 +2592,11 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3266,7 +2605,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3284,21 +2623,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -3333,30 +2658,13 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Imports a bacpac into a new database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3364,52 +2672,124 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.databaseName The name of the database to import. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Default: regular database creation. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {object} [options] Optional Parameters. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * * @param {function} callback - The callback. * @@ -3418,13 +2798,13 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3434,21 +2814,24 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3458,10 +2841,11 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3470,7 +2854,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3493,7 +2877,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportRequest']().mapper(); + let requestModelMapper = new client.models['Database']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3509,7 +2893,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3544,7 +2928,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3554,14 +2938,30 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3569,31 +2969,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3606,14 +2982,13 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3623,17 +2998,9 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let extensionName = 'import'; - if (parameters === null || parameters === undefined) - { - parameters = {}; - } + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3643,8 +3010,8 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3655,12 +3022,11 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3669,7 +3035,7 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3687,28 +3053,14 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3736,30 +3088,13 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Exports a database to a bacpac. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3767,26 +3102,117 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for exporting a database. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3800,13 +3226,13 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3816,12 +3242,9 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3834,6 +3257,9 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3843,11 +3269,11 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3856,7 +3282,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3879,7 +3305,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExportRequest']().mapper(); + let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3930,7 +3356,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3945,42 +3371,1150 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet }); } -/** Class representing a Databases. */ -class Databases { - /** - * Create a Databases. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._pause = _pause; - this._resume = _resume; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; - this._getByElasticPool = _getByElasticPool; - this._listByElasticPool = _listByElasticPool; - this._getByRecommendedElasticPool = _getByRecommendedElasticPool; - this._listByRecommendedElasticPool = _listByRecommendedElasticPool; - this._importMethod = _importMethod; - this._createImportOperation = _createImportOperation; - this._exportMethod = _exportMethod; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; - this._rename = _rename; - this._beginPause = _beginPause; - this._beginResume = _beginResume; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._beginImportMethod = _beginImportMethod; - this._beginCreateImportOperation = _beginCreateImportOperation; - this._beginExportMethod = _beginExportMethod; +/** + * Pauses a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be paused. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Resumes a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be resumed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of databases in an elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPoolNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Databases. */ +class Databases { + /** + * Create a Databases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._importMethod = _importMethod; + this._createImportOperation = _createImportOperation; + this._exportMethod = _exportMethod; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._upgradeDataWarehouse = _upgradeDataWarehouse; + this._listByServer = _listByServer; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listByElasticPool = _listByElasticPool; + this._pause = _pause; + this._resume = _resume; + this._rename = _rename; + this._beginImportMethod = _beginImportMethod; + this._beginCreateImportOperation = _beginCreateImportOperation; + this._beginExportMethod = _beginExportMethod; + this._beginUpgradeDataWarehouse = _beginUpgradeDataWarehouse; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._beginPause = _beginPause; + this._beginResume = _beginResume; + this._listByServerNext = _listByServerNext; + this._listByElasticPoolNext = _listByElasticPoolNext; + } + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Imports a bacpac into a new database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Exports a database to a bacpac. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Returns database metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns database metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); + } } /** - * Pauses a data warehouse. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3988,7 +4522,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3997,15 +4531,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4016,7 +4550,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4024,7 +4558,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4038,7 +4572,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4046,13 +4580,15 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4061,19 +4597,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Resumes a data warehouse. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4081,7 +4617,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -4094,11 +4630,11 @@ class Databases { * * @reject {Error} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4109,7 +4645,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4117,7 +4653,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -4145,7 +4681,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { + upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4154,19 +4690,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates a new database or updates an existing database. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4174,146 +4710,97 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * Default: regular database creation. + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of databases. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} 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 {string} serverName The name of the server. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {object} [options] Optional Parameters. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {function} [optionalCallback] - The optional callback. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {Promise} A promise is returned * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @resolve {DatabaseListResult} - The deserialized result object. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @reject {Error} - The error object. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {function} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * - * @param {object} [parameters.tags] Resource tags. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} parameters.location Resource location. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Gets a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4326,11 +4813,11 @@ class Databases { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4341,7 +4828,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4349,146 +4836,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4517,7 +4865,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4526,19 +4874,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Updates an existing database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4546,14 +4894,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The requested database resource state. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -4563,9 +4921,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -4586,103 +4944,70 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4694,11 +5019,11 @@ class Databases { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4709,7 +5034,7 @@ class Databases { } /** - * Updates an existing database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4717,14 +5042,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -4734,9 +5069,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -4757,103 +5092,70 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4881,7 +5183,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4890,19 +5192,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Deletes a database. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4910,7 +5212,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4938,7 +5240,7 @@ class Databases { } /** - * Deletes a database. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4946,7 +5248,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4995,7 +5297,7 @@ class Databases { } /** - * Gets a database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5003,13 +5305,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5020,11 +5428,11 @@ class Databases { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5035,7 +5443,7 @@ class Databases { } /** - * Gets a database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5043,117 +5451,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {Promise} A promise is returned + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @resolve {Database} - The deserialized result object. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @reject {Error} - The error object. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * {function} optionalCallback(err, result, request, response) + * Default: regular database creation. * - * {Error} err - The Error object if an error occurred, null otherwise. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * {object} [request] - The HTTP Request object if an error did not occur. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Returns a list of databases in a server. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @param {string} 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. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} serverName The name of the server. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {object} [options] Optional Parameters. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @returns {Promise} A promise is returned + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @reject {Error} - The error object. - */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns a list of databases in a server. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} 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 {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5165,7 +5575,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5174,13 +5584,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5189,19 +5599,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5209,10 +5619,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5221,15 +5628,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, databaseName, options) { + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5240,7 +5647,7 @@ class Databases { } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5248,10 +5655,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5265,7 +5669,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5274,13 +5678,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback) { + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5289,19 +5693,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback); + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Returns a list of databases in an elastic pool. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5309,8 +5713,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5319,15 +5722,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5338,7 +5741,7 @@ class Databases { } /** - * Returns a list of databases in an elastic pool. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5346,8 +5749,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5361,7 +5763,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5370,13 +5772,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5385,19 +5787,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Gets a database inside of a recommented elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5405,10 +5807,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5421,11 +5820,11 @@ class Databases { * * @reject {Error} - The error object. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options) { + resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5436,7 +5835,7 @@ class Databases { } /** - * Gets a database inside of a recommented elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5444,10 +5843,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5476,7 +5872,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback) { + resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5485,19 +5881,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback); + return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5505,8 +5901,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5515,15 +5915,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, options) { + renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5534,7 +5934,7 @@ class Databases { } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5542,8 +5942,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5557,7 +5961,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5565,14 +5969,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback) { + rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5581,14 +5984,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback); + return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } @@ -5654,11 +6057,11 @@ class Databases { * * @reject {Error} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5746,7 +6149,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5755,14 +6158,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); } } @@ -5813,11 +6216,11 @@ class Databases { * * @reject {Error} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5890,7 +6293,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5899,14 +6302,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } @@ -5951,11 +6354,11 @@ class Databases { * * @reject {Error} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6022,7 +6425,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6031,19 +6434,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns database metrics. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6051,10 +6454,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -6063,15 +6463,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { + beginUpgradeDataWarehouseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6082,7 +6482,7 @@ class Databases { } /** - * Returns database metrics. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6090,10 +6490,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -6107,7 +6504,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6115,14 +6512,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { + beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6131,19 +6527,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); + return self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns database metric definitions. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6153,203 +6549,117 @@ class Databases { * * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @returns {Promise} A promise is returned + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @reject {Error} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns database metric definitions. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} 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 {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} serverName The name of the server. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {object} [options] Optional Parameters. + * Default: regular database creation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {function} [optionalCallback] - The optional callback. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {Promise} A promise is returned + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @reject {Error} - The error object. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * {function} optionalCallback(err, result, request, response) + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.collation] The collation of the database. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Renames a database. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} 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 {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} serverName The name of the server. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} databaseName The name of the database to rename. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {object} parameters The resource move definition for renaming this + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this * database. * - * @param {string} parameters.id The target ID for the resource - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Renames a database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to rename. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} parameters The resource move definition for renaming this + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this * database. * - * @param {string} parameters.id The target ID for the resource - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); - } - } - - /** - * Pauses a data warehouse. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} 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 {string} [parameters.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 {string} serverName The name of the server. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6358,15 +6668,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6377,7 +6687,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6385,7 +6695,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6399,7 +6821,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6407,13 +6829,14 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6422,19 +6845,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6442,7 +6865,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6455,11 +6878,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6470,7 +6893,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6478,7 +6901,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6506,7 +6929,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6515,19 +6938,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6535,14 +6958,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -6552,9 +6985,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -6575,106 +7008,67 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6687,11 +7081,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6702,7 +7096,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6710,14 +7104,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -6727,9 +7131,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -6750,106 +7154,67 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6878,7 +7243,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6887,19 +7252,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Updates an existing database. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6907,142 +7272,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -7055,11 +7285,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7069,151 +7299,16 @@ class Databases { }); } - /** - * Updates an existing database. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + /** + * Pauses a database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} 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 {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -7242,7 +7337,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7251,19 +7346,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Imports a bacpac into a new database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7271,47 +7366,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -7320,15 +7375,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7339,7 +7394,7 @@ class Databases { } /** - * Imports a bacpac into a new database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7347,47 +7402,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -7401,7 +7416,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7410,13 +7425,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7425,52 +7440,22 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Gets a list of databases. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7479,15 +7464,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByServerNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7498,40 +7483,10 @@ class Databases { } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. + * Gets a list of databases. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7545,7 +7500,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7554,13 +7509,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByServerNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7569,46 +7524,22 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByServerNext(nextPageLink, options, optionalCallback); } } /** - * Exports a database to a bacpac. + * Gets a list of databases in an elastic pool. * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7617,15 +7548,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByElasticPoolNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7636,34 +7567,10 @@ class Databases { } /** - * Exports a database to a bacpac. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * Gets a list of databases in an elastic pool. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7677,7 +7584,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7686,13 +7593,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByElasticPoolNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7701,14 +7608,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByElasticPoolNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/elasticPools.js b/lib/services/sqlManagement2/lib/operations/elasticPools.js index b0c55afc5e..00900cb8d8 100644 --- a/lib/services/sqlManagement2/lib/operations/elasticPools.js +++ b/lib/services/sqlManagement2/lib/operations/elasticPools.js @@ -14,118 +14,8 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; - -/** - * Creates a new elastic pool or updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - /** - * Updates an existing elastic pool. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -133,31 +23,10 @@ function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, paramet * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -171,93 +40,13 @@ function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, paramet * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Deletes the elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -282,6 +71,9 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -291,20 +83,21 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -329,7 +122,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -357,13 +150,30 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MetricListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets an elastic pool. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -371,8 +181,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -386,13 +195,14 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -426,7 +236,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -499,7 +309,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -515,7 +325,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) } /** - * Returns a list of elastic pools in a server. + * Gets all elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -525,6 +335,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -551,18 +364,22 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -573,10 +390,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -660,7 +480,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { } /** - * Returns elastic pool metrics. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -670,9 +490,6 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -685,13 +502,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { +function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -701,12 +518,9 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -716,8 +530,8 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -728,14 +542,13 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -802,7 +615,7 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -817,8 +630,9 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op }); } + /** - * Returns elastic pool metric definitions. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -828,6 +642,46 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * * @param {string} elasticPoolName The name of the elastic pool. * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -840,121 +694,50 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -963,14 +746,15 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Creates a new elastic pool or updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -978,34 +762,112 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {function} callback - The callback. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @returns {function} callback(err, result, request, response) * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.tags] Resource tags. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an elastic pool. * - * @param {string} parameters.location Resource location. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1025,53 +887,174 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1182,7 +1165,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa } /** - * Updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1190,31 +1173,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1227,14 +1186,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1244,12 +1202,9 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -1259,8 +1214,8 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1272,10 +1227,10 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1284,7 +1239,7 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1302,28 +1257,14 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ElasticPoolUpdate']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1351,112 +1292,503 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } -/** Class representing a ElasticPools. */ -class ElasticPools { - /** - * Create a ElasticPools. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - } - - /** - * Creates a new elastic pool or updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a new elastic pool or updates an existing elastic pool. +/** + * Updates an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ElasticPoolUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all elastic pools in a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ElasticPools. */ +class ElasticPools { + /** + * Create a ElasticPools. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._listByServer = _listByServer; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listByServerNext = _listByServerNext; + } + + /** + * Returns elastic pool metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + } + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1464,34 +1796,198 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {function} [optionalCallback] - The optional callback. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * {Promise} A promise is returned * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @reject {Error} - The error object. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * {function} optionalCallback(err, result, request, response) * - * @param {object} [parameters.tags] Resource tags. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} parameters.location Resource location. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * Gets all elastic pools in a server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all elastic pools in a server. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Gets an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1520,7 +2016,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1529,19 +2025,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1549,31 +2045,47 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {object} parameters The elastic pool parameters. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1586,11 +2098,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1601,39 +2113,55 @@ class ElasticPools { } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {object} [parameters.tags] Resource tags. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1662,7 +2190,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1671,19 +2199,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1691,7 +2219,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1719,7 +2247,7 @@ class ElasticPools { } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1727,7 +2255,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1776,7 +2304,7 @@ class ElasticPools { } /** - * Gets an elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1784,8 +2312,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1798,11 +2363,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1813,7 +2378,7 @@ class ElasticPools { } /** - * Gets an elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1821,8 +2386,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1851,7 +2453,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1860,53 +2462,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Returns a list of elastic pools in a server. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns a list of elastic pools in a server. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1914,66 +2482,47 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters The elastic pool parameters. * - * @param {function} [optionalCallback] - The optional callback. + * @param {object} [parameters.sku] * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * {Promise} A promise is returned + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @reject {Error} - The error object. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {function} optionalCallback(err, result, request, response) + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolListResult} for more information. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByServer(resourceGroupName, serverName, options, optionalCallback); - } - } - - /** - * Returns elastic pool metrics. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {string} 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 {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1982,15 +2531,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2001,7 +2550,7 @@ class ElasticPools { } /** - * Returns elastic pool metrics. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2011,8 +2560,45 @@ class ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -2026,7 +2612,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2035,13 +2621,13 @@ class ElasticPools { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2050,19 +2636,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Returns elastic pool metric definitions. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2079,15 +2665,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2098,7 +2684,7 @@ class ElasticPools { } /** - * Returns elastic pool metric definitions. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2120,7 +2706,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2128,15 +2714,13 @@ class ElasticPools { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2145,19 +2729,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2165,34 +2749,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [parameters.sku] * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {string} parameters.location Resource location. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2205,11 +2800,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2220,7 +2815,7 @@ class ElasticPools { } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2228,34 +2823,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} parameters The elastic pool update parameters. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.sku] * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} [parameters.tags] Resource tags. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} parameters.location Resource location. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2284,7 +2890,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2293,51 +2899,22 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * Gets all elastic pools in a server. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2346,15 +2923,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + listByServerNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2365,39 +2942,10 @@ class ElasticPools { } /** - * Updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. + * Gets all elastic pools in a server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2411,7 +2959,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2420,13 +2968,13 @@ class ElasticPools { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * See {@link ElasticPoolListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + listByServerNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2435,14 +2983,14 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._listByServerNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index c6a881e1ec..c753734bba 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -297,70 +297,6 @@ export interface RestorableDroppedDatabases { listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * Capabilities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Capabilities { - - - /** - * Gets the capabilities available for the specified location. - * - * @param {string} locationId The location id whose capabilities are retrieved. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByLocationWithHttpOperationResponse(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the capabilities available for the specified location. - * - * @param {string} locationId The location id whose capabilities are retrieved. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {LocationCapabilities} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. - * See {@link LocationCapabilities} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByLocation(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocation(locationId: string, callback: ServiceCallback): void; - listByLocation(locationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * Servers @@ -1382,15 +1318,15 @@ export interface ServerConnectionPolicies { /** * @class - * Databases + * DatabaseThreatDetectionPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface Databases { +export interface DatabaseThreatDetectionPolicies { /** - * Pauses a data warehouse. + * Gets a database's threat detection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1398,7 +1334,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. * * @param {object} [options] Optional Parameters. * @@ -1407,14 +1344,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * Gets a database's threat detection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1422,7 +1359,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. * * @param {object} [options] Optional Parameters. * @@ -1436,7 +1374,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1444,19 +1382,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseSecurityAlertPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - pause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - pause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resumes a data warehouse. + * Creates or updates a database's threat detection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1464,7 +1404,44 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} parameters The database Threat Detection policy. + * + * @param {string} [parameters.location] The geo-location where the resource + * lives + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'New', 'Enabled', 'Disabled' + * + * @param {string} [parameters.disabledAlerts] Specifies the + * semicolon-separated list of alerts that are disabled, or empty string to + * disable no alerts. Possible values: Sql_Injection; + * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * + * @param {string} [parameters.emailAddresses] Specifies the + * semicolon-separated list of e-mail addresses to which the alert is sent. + * + * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. If state is Enabled, + * storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. If state is + * Enabled, storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {string} [parameters.useServerDefault] Specifies whether to use the + * default server policy. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -1473,14 +1450,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * Creates or updates a database's threat detection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1488,7 +1465,44 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. + * + * @param {object} parameters The database Threat Detection policy. + * + * @param {string} [parameters.location] The geo-location where the resource + * lives + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'New', 'Enabled', 'Disabled' + * + * @param {string} [parameters.disabledAlerts] Specifies the + * semicolon-separated list of alerts that are disabled, or empty string to + * disable no alerts. Possible values: Sql_Injection; + * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * + * @param {string} [parameters.emailAddresses] Specifies the + * semicolon-separated list of e-mail addresses to which the alert is sent. + * + * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. If state is Enabled, + * storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. If state is + * Enabled, storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {string} [parameters.useServerDefault] Specifies whether to use the + * default server policy. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -1502,7 +1516,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1510,19 +1524,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseSecurityAlertPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - resume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - resume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DataMaskingPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DataMaskingPolicies { /** - * Creates a new database or updates an existing database. + * Creates or updates a database data masking policy * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1530,146 +1555,18 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {object} parameters Parameters for creating or updating a data + * masking policy. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.exemptPrincipals] The list of the exempt + * principals. Specifies the semicolon-separated list of database users for + * which the data masking policy does not apply. The specified users receive + * data results without masking for all of the database queries. * * @param {object} [options] Optional Parameters. * @@ -1678,14 +1575,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * Creates or updates a database data masking policy * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1693,146 +1590,85 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} parameters Parameters for creating or updating a data + * masking policy. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} parameters.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} [parameters.exemptPrincipals] The list of the exempt + * principals. Specifies the semicolon-separated list of database users for + * which the data masking policy does not apply. The specified users receive + * data results without masking for all of the database queries. * - * Default: regular database creation. + * @param {object} [options] Optional Parameters. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {Promise} A promise is returned. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @resolve {DataMaskingPolicy} - The deserialized result object. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @reject {Error|ServiceError} - The error object. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingPolicy} for more information. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database data masking policy. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} 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 {string} parameters.location Resource location. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database data masking policy. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1846,7 +1682,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {DataMaskingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1854,20 +1690,29 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingPolicy} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DataMaskingRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DataMaskingRules { /** - * Updates an existing database. + * Creates or updates a database data masking rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1875,142 +1720,336 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. * - * Default: regular database creation. + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a database data masking rule. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. + * + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. + * + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. + * + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. + * + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. + * + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. + * + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' + * + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMaskingRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMaskingRule} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of database data masking rules. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of database data masking rules. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMaskingRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMaskingRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataMaskingRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FirewallRules { + + + /** + * Creates or updates a firewall rule. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} firewallRuleName The name of the firewall rule. + * + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address of the + * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all + * Azure-internal IP addresses. + * + * @param {string} parameters.endIpAddress The end IP address of the firewall + * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. + * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a firewall rule. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} firewallRuleName The name of the firewall rule. + * + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address of the + * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all + * Azure-internal IP addresses. + * + * @param {string} parameters.endIpAddress The end IP address of the firewall + * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. + * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FirewallRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a firewall rule. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2019,14 +2058,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * Deletes a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2034,142 +2073,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2183,7 +2087,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2191,20 +2095,19 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a database. + * Gets a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2212,7 +2115,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2221,14 +2124,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a database. + * Gets a firewall rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2236,7 +2139,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2250,7 +2153,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2258,19 +2161,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database. + * Returns a list of firewall rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2278,27 +2182,21 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database. + * Returns a list of firewall rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2306,14 +2204,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2324,7 +2216,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {FirewallRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2332,20 +2224,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRuleListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * GeoBackupPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface GeoBackupPolicies { /** - * Returns a list of databases in a server. + * Updates a database geo backup policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2353,28 +2255,29 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in a server. + * Updates a database geo backup policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2382,14 +2285,15 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2401,7 +2305,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2409,20 +2313,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicy} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database inside of an elastic pool. + * Gets a geo backup policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2430,10 +2334,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2442,14 +2343,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of an elastic pool. + * Gets a geo backup policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2457,10 +2358,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2474,7 +2372,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2482,20 +2380,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicy} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, callback: ServiceCallback): void; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases in an elastic pool. + * Returns a list of geo backup policies. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2503,8 +2401,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2513,14 +2410,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in an elastic pool. + * Returns a list of geo backup policies. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2528,8 +2425,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2543,7 +2439,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {GeoBackupPolicyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2551,31 +2447,78 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {GeoBackupPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicyListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Databases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Databases { /** - * Gets a database inside of a recommented elastic pool. + * Imports a bacpac into a new database. * * @param {string} 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 {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2584,14 +2527,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of a recommented elastic pool. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2599,10 +2542,47 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2616,7 +2596,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2624,20 +2604,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, callback: ServiceCallback): void; - getByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases inside a recommented elastic pool. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2645,8 +2626,31 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2655,14 +2659,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases inside a recommented elastic pool. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2670,8 +2675,31 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2685,7 +2713,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2693,20 +2721,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - listByRecommendedElasticPool(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Imports a bacpac into a new database. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2714,30 +2742,9 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} databaseName The name of the database to be exported. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {object} parameters The required parameters for exporting a database. * * @param {string} parameters.storageKeyType The type of the storage key to * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' @@ -2767,10 +2774,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Imports a bacpac into a new database. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2778,30 +2785,9 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} databaseName The name of the database to be exported. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {object} parameters The required parameters for exporting a database. * * @param {string} parameters.storageKeyType The type of the storage key to * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' @@ -2847,14 +2833,13 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2862,31 +2847,80 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * - * @param {string} [parameters.name] The name of the extension. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.type] The type of the extension. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @returns {Promise} A promise is returned * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns database metrics. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} parameters.storageUri The storage uri to use. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns database metric definitions. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} 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 {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2895,15 +2929,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2911,31 +2944,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2949,7 +2958,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2957,20 +2966,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Exports a database to a bacpac. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2978,26 +2988,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3006,14 +2997,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3021,26 +3012,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3054,7 +3026,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3062,20 +3034,19 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + upgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + upgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + upgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database metrics. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3083,11 +3054,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3095,14 +3061,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metrics. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3110,11 +3076,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3127,7 +3088,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3135,20 +3096,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database metric definitions. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3165,14 +3126,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metric definitions. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3194,7 +3155,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3202,21 +3163,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Renames a database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3224,12 +3184,119 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to rename. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The resource move definition for renaming this + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this * database. * - * @param {string} parameters.id The target ID for the resource + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -3238,14 +3305,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Renames a database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3253,78 +3320,119 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to rename. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The resource move definition for renaming this - * database. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.id The target ID for the resource + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [options] Optional Parameters. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * {Promise} A promise is returned. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @resolve {null} - The deserialized result object. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.collation] The collation of the database. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; - rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Pauses a data warehouse. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} 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 {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @reject {Error|ServiceError} - The error object. - */ - beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Pauses a data warehouse. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} 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 {string} [parameters.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 {string} serverName The name of the server. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -3338,7 +3446,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3346,19 +3454,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3366,7 +3475,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3379,10 +3488,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3390,7 +3499,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3418,13 +3527,13 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginResume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginResume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - beginResume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3432,14 +3541,24 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -3449,9 +3568,9 @@ export interface Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -3472,106 +3591,67 @@ export interface Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3584,10 +3664,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3595,14 +3675,24 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -3612,9 +3702,9 @@ export interface Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -3635,106 +3725,201 @@ export interface Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of databases in an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of databases in an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Pauses a database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be paused. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Pauses a database. + * + * @param {string} 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 {string} serverName The name of the server. * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -3763,13 +3948,13 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + pause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + pause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + pause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3777,158 +3962,66 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database to be resumed. * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @returns {Promise} A promise is returned * - * Default: regular database creation. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @reject {Error|ServiceError} - The error object. + */ + resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resumes a database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} 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. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {string} serverName The name of the server. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} databaseName The name of the database to be resumed. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} [options] Optional Parameters. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {Promise} A promise is returned. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @resolve {Database} - The deserialized result object. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @reject {Error|ServiceError} - The error object. * - * @param {object} [options] Optional Parameters. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @returns {Promise} A promise is returned + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @reject {Error|ServiceError} - The error object. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + resume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + resume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Updates an existing database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3936,142 +4029,41 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} databaseName The name of the database to rename. * - * Default: regular database creation. + * @param {object} parameters The resource move definition for renaming this + * database. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} parameters.id The target ID for the resource * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {object} [options] Optional Parameters. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @returns {Promise} A promise is returned * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @reject {Error|ServiceError} - The error object. + */ + renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Renames a database. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} 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 {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} databaseName The name of the database to rename. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -4085,7 +4077,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4093,16 +4085,15 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4472,19 +4463,34 @@ export interface Databases { beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} -/** - * @class - * DatabaseThreatDetectionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseThreatDetectionPolicies { + /** + * Upgrades a data warehouse. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be upgraded. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's threat detection policy. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4492,69 +4498,177 @@ export interface DatabaseThreatDetectionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new database or updates an existing database. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database's threat detection policy. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} 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 {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * {Promise} A promise is returned. + * @param {string} [parameters.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' * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @param {object} [parameters.tags] Resource tags. * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.location Resource location. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [options] Optional Parameters. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's threat detection policy. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4562,105 +4676,119 @@ export interface DatabaseThreatDetectionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The database Threat Detection policy. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.location] The geo-location where the resource - * lives + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * Default: regular database creation. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {object} [options] Optional Parameters. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @returns {Promise} A promise is returned + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a database's threat detection policy. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {string} 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. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} serverName The name of the server. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {object} parameters The database Threat Detection policy. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {string} [parameters.location] The geo-location where the resource - * lives + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.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 {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -4674,7 +4802,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4682,30 +4810,20 @@ export interface DatabaseThreatDetectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DataMaskingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DataMaskingPolicies { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database data masking policy + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4715,17 +4833,6 @@ export interface DataMaskingPolicies { * * @param {string} databaseName The name of the database. * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. - * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4733,14 +4840,14 @@ export interface DataMaskingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking policy + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4750,17 +4857,6 @@ export interface DataMaskingPolicies { * * @param {string} databaseName The name of the database. * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. - * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4773,7 +4869,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4781,20 +4877,19 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database data masking policy. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4804,73 +4899,131 @@ export interface DataMaskingPolicies { * * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @returns {Promise} A promise is returned + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database data masking policy. + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} 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 {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * {Promise} A promise is returned. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.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' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DataMaskingRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DataMaskingRules { - + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking rule. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4880,125 +5033,115 @@ export interface DataMaskingRules { * * @param {string} databaseName The name of the database. * - * @param {string} dataMaskingRuleName The name of the data masking rule. - * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. - * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. + * Default: regular database creation. * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options] Optional Parameters. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @returns {Promise} A promise is returned + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a database data masking rule. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} 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 {string} [parameters.collation] The collation of the database. * - * @param {string} serverName The name of the server. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {string} dataMaskingRuleName The name of the data masking rule. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. + * @param {string} [parameters.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 {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5012,7 +5155,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRule} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5020,20 +5163,20 @@ export interface DataMaskingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingRule} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingRule} for more information. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database data masking rules. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5041,7 +5184,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5050,14 +5193,14 @@ export interface DataMaskingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database data masking rules. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5065,7 +5208,7 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5079,7 +5222,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRuleListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5087,30 +5230,20 @@ export interface DataMaskingRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingRuleListResult} for more - * information. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPools { + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5118,34 +5251,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5154,14 +5260,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5169,34 +5275,64 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} databaseName The name of the database to be resumed. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of databases. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @returns {Promise} A promise is returned * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags. + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of databases. * - * @param {string} parameters.location Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5210,7 +5346,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5218,52 +5354,23 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * Gets a list of databases in an elastic pool. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5272,46 +5379,17 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. + * Gets a list of databases in an elastic pool. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5325,7 +5403,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5333,20 +5411,29 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPoolNext(nextPageLink: string, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPools { /** - * Deletes the elastic pool. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5354,7 +5441,10 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -5363,14 +5453,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the elastic pool. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5378,7 +5468,10 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -5392,7 +5485,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {MetricListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5400,19 +5493,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets an elastic pool. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5420,8 +5514,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5430,14 +5523,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an elastic pool. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5445,8 +5538,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5460,7 +5552,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5468,20 +5560,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of elastic pools in a server. + * Gets all elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5491,6 +5584,9 @@ export interface ElasticPools { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5500,10 +5596,10 @@ export interface ElasticPools { * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { skip? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of elastic pools in a server. + * Gets all elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5513,6 +5609,9 @@ export interface ElasticPools { * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5538,13 +5637,13 @@ export interface ElasticPools { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, options?: { skip? : number, customHeaders? : { [headerName: string]: string; } }): Promise; listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { skip? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool metrics. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5554,9 +5653,6 @@ export interface ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5564,14 +5660,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metrics. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5581,9 +5677,6 @@ export interface ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5596,7 +5689,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5604,20 +5697,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool metric definitions. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5627,6 +5720,46 @@ export interface ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5634,14 +5767,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metric definitions. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5651,6 +5784,46 @@ export interface ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5663,7 +5836,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5671,21 +5844,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5693,34 +5865,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5729,14 +5874,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5744,34 +5889,7 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5785,7 +5903,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5793,52 +5911,65 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. + * Updates an elastic pool. + * + * @param {string} 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 {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} 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 {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} [parameters.tags] Resource tags. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5851,10 +5982,10 @@ export interface ElasticPools { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5862,31 +5993,45 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {object} parameters The elastic pool update parameters. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -5915,22 +6060,13 @@ export interface ElasticPools { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FirewallRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface FirewallRules { + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a firewall rule. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5938,18 +6074,47 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * @param {object} parameters The elastic pool parameters. * - * @param {string} parameters.startIpAddress The start IP address of the - * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - * Azure-internal IP addresses. + * @param {object} [parameters.sku] * - * @param {string} parameters.endIpAddress The end IP address of the firewall - * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. - * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -5958,14 +6123,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a firewall rule. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5973,18 +6138,47 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * @param {object} parameters The elastic pool parameters. * - * @param {string} parameters.startIpAddress The start IP address of the - * firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - * Azure-internal IP addresses. + * @param {object} [parameters.sku] * - * @param {string} parameters.endIpAddress The end IP address of the firewall - * rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. - * Use value '0.0.0.0' to represent all Azure-internal IP addresses. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -5998,7 +6192,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6006,20 +6200,20 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a firewall rule. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6027,7 +6221,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -6040,10 +6234,10 @@ export interface FirewallRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a firewall rule. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6051,7 +6245,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -6079,13 +6273,13 @@ export interface FirewallRules { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a firewall rule. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6093,7 +6287,45 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6102,14 +6334,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a firewall rule. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6117,7 +6349,45 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6131,7 +6401,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6139,26 +6409,23 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of firewall rules. - * - * @param {string} 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. + * Gets all elastic pools in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6167,20 +6434,17 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of firewall rules. - * - * @param {string} 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. + * Gets all elastic pools in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6194,7 +6458,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRuleListResult} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6202,30 +6466,29 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRuleListResult} for more - * information. + * {ElasticPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * GeoBackupPolicies + * RecommendedElasticPools * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface GeoBackupPolicies { +export interface RecommendedElasticPools { /** - * Updates a database geo backup policy. + * Gets a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6233,13 +6496,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. - * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -6248,14 +6506,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database geo backup policy. + * Gets a recommented elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6263,13 +6521,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. - * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -6283,7 +6536,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {RecommendedElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6291,20 +6544,21 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {RecommendedElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPool} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a geo backup policy. + * Returns recommended elastic pools. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6312,8 +6566,6 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6321,14 +6573,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a geo backup policy. + * Returns recommended elastic pools. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6336,8 +6588,6 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6350,7 +6600,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6358,20 +6608,21 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {RecommendedElasticPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPoolListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of geo backup policies. + * Returns recommented elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6379,7 +6630,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -6388,14 +6640,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of geo backup policies. + * Returns recommented elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6403,7 +6655,8 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -6417,7 +6670,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicyListResult} - The deserialized result object. + * @resolve {RecommendedElasticPoolListMetricsResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6425,17 +6678,17 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicyListResult} for more - * information. + * {RecommendedElasticPoolListMetricsResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendedElasticPoolListMetricsResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -7641,229 +7894,7 @@ export interface ServerCommunicationLinks { listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server communication links. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLinkListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a server communication link. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. - * - * @param {string} parameters.partnerServer The name of the partner server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a server communication link. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. - * - * @param {string} parameters.partnerServer The name of the partner server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ServerCommunicationLink} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceObjectives - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServiceObjectives { - - - /** - * Gets a database service objective. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database service objective. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ServiceObjective} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ServiceObjective} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjective} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns database service objectives. - * - * @param {string} 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 {string} serverName The name of the server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns database service objectives. + * Gets a list of server communication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7883,7 +7914,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjectiveListResult} - The deserialized result object. + * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7891,30 +7922,21 @@ export interface ServiceObjectives { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjectiveListResult} for more + * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLinkListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPoolActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolActivities { + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool activities. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7922,8 +7944,13 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -7932,14 +7959,14 @@ export interface ElasticPoolActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool activities. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7947,8 +7974,13 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -7962,7 +7994,7 @@ export interface ElasticPoolActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolActivityListResult} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7970,30 +8002,30 @@ export interface ElasticPoolActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolActivityListResult} for more + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ElasticPoolDatabaseActivities + * ServiceObjectives * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ElasticPoolDatabaseActivities { +export interface ServiceObjectives { /** - * Returns activity on databases inside of an elastic pool. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8001,7 +8033,8 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -8010,14 +8043,14 @@ export interface ElasticPoolDatabaseActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns activity on databases inside of an elastic pool. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8025,7 +8058,8 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -8039,7 +8073,7 @@ export interface ElasticPoolDatabaseActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. + * @resolve {ServiceObjective} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8047,30 +8081,20 @@ export interface ElasticPoolDatabaseActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolDatabaseActivityListResult} for - * more information. + * {ServiceObjective} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjective} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RecommendedElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RecommendedElasticPools { + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a recommented elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8078,9 +8102,6 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8088,14 +8109,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recommented elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8103,9 +8124,6 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8118,7 +8136,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPool} - The deserialized result object. + * @resolve {ServiceObjectiveListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8126,21 +8144,30 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPool} for more + * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjectiveListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolActivities { /** - * Returns recommended elastic pools. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8148,6 +8175,9 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8155,14 +8185,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommended elastic pools. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8170,6 +8200,9 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8182,7 +8215,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. + * @resolve {ElasticPoolActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8190,21 +8223,30 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListResult} for more + * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolActivityListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolDatabaseActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolDatabaseActivities { /** - * Returns recommented elastic pool metrics. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8212,8 +8254,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -8222,14 +8263,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommented elastic pool metrics. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8237,8 +8278,7 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -8252,7 +8292,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListMetricsResult} - The deserialized result object. + * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8260,17 +8300,17 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListMetricsResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListMetricsResult} for + * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolDatabaseActivityListResult} for * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -17937,3 +17977,79 @@ export interface ElasticPoolOperations { listByElasticPoolNext(nextPageLink: string, callback: ServiceCallback): void; listByElasticPoolNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * Capabilities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Capabilities { + + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param {string} locationName The location name whose capabilities are + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param {string} locationName The location name whose capabilities are + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocationCapabilities} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. + * See {@link LocationCapabilities} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { include? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index ed7f47bc24..56d738959a 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -16,23 +16,22 @@ exports.RecoverableDatabases = require('./recoverableDatabases'); exports.RestorableDroppedDatabases = require('./restorableDroppedDatabases'); -exports.Capabilities = require('./capabilities'); exports.Servers = require('./servers'); exports.ServerConnectionPolicies = require('./serverConnectionPolicies'); -exports.Databases = require('./databases'); exports.DatabaseThreatDetectionPolicies = require('./databaseThreatDetectionPolicies'); exports.DataMaskingPolicies = require('./dataMaskingPolicies'); exports.DataMaskingRules = require('./dataMaskingRules'); -exports.ElasticPools = require('./elasticPools'); exports.FirewallRules = require('./firewallRules'); exports.GeoBackupPolicies = require('./geoBackupPolicies'); +exports.Databases = require('./databases'); +exports.ElasticPools = require('./elasticPools'); +exports.RecommendedElasticPools = require('./recommendedElasticPools'); exports.ReplicationLinks = require('./replicationLinks'); exports.ServerAzureADAdministrators = require('./serverAzureADAdministrators'); exports.ServerCommunicationLinks = require('./serverCommunicationLinks'); exports.ServiceObjectives = require('./serviceObjectives'); exports.ElasticPoolActivities = require('./elasticPoolActivities'); exports.ElasticPoolDatabaseActivities = require('./elasticPoolDatabaseActivities'); -exports.RecommendedElasticPools = require('./recommendedElasticPools'); exports.ServiceTierAdvisors = require('./serviceTierAdvisors'); exports.TransparentDataEncryptions = require('./transparentDataEncryptions'); exports.TransparentDataEncryptionActivities = require('./transparentDataEncryptionActivities'); @@ -56,3 +55,4 @@ exports.ServerDnsAliases = require('./serverDnsAliases'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); +exports.Capabilities = require('./capabilities'); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index a37373a060..951e647e01 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -56,23 +56,22 @@ export default class SqlManagementClient extends AzureServiceClient { // Operation groups recoverableDatabases: operations.RecoverableDatabases; restorableDroppedDatabases: operations.RestorableDroppedDatabases; - capabilities: operations.Capabilities; servers: operations.Servers; serverConnectionPolicies: operations.ServerConnectionPolicies; - databases: operations.Databases; databaseThreatDetectionPolicies: operations.DatabaseThreatDetectionPolicies; dataMaskingPolicies: operations.DataMaskingPolicies; dataMaskingRules: operations.DataMaskingRules; - elasticPools: operations.ElasticPools; firewallRules: operations.FirewallRules; geoBackupPolicies: operations.GeoBackupPolicies; + databases: operations.Databases; + elasticPools: operations.ElasticPools; + recommendedElasticPools: operations.RecommendedElasticPools; replicationLinks: operations.ReplicationLinks; serverAzureADAdministrators: operations.ServerAzureADAdministrators; serverCommunicationLinks: operations.ServerCommunicationLinks; serviceObjectives: operations.ServiceObjectives; elasticPoolActivities: operations.ElasticPoolActivities; elasticPoolDatabaseActivities: operations.ElasticPoolDatabaseActivities; - recommendedElasticPools: operations.RecommendedElasticPools; serviceTierAdvisors: operations.ServiceTierAdvisors; transparentDataEncryptions: operations.TransparentDataEncryptions; transparentDataEncryptionActivities: operations.TransparentDataEncryptionActivities; @@ -96,6 +95,7 @@ export default class SqlManagementClient extends AzureServiceClient { restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; + capabilities: operations.Capabilities; } export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index cd18ce1370..4c2f9a8ebd 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -73,23 +73,22 @@ class SqlManagementClient extends ServiceClient { } this.recoverableDatabases = new operations.RecoverableDatabases(this); this.restorableDroppedDatabases = new operations.RestorableDroppedDatabases(this); - this.capabilities = new operations.Capabilities(this); this.servers = new operations.Servers(this); this.serverConnectionPolicies = new operations.ServerConnectionPolicies(this); - this.databases = new operations.Databases(this); this.databaseThreatDetectionPolicies = new operations.DatabaseThreatDetectionPolicies(this); this.dataMaskingPolicies = new operations.DataMaskingPolicies(this); this.dataMaskingRules = new operations.DataMaskingRules(this); - this.elasticPools = new operations.ElasticPools(this); this.firewallRules = new operations.FirewallRules(this); this.geoBackupPolicies = new operations.GeoBackupPolicies(this); + this.databases = new operations.Databases(this); + this.elasticPools = new operations.ElasticPools(this); + this.recommendedElasticPools = new operations.RecommendedElasticPools(this); this.replicationLinks = new operations.ReplicationLinks(this); this.serverAzureADAdministrators = new operations.ServerAzureADAdministrators(this); this.serverCommunicationLinks = new operations.ServerCommunicationLinks(this); this.serviceObjectives = new operations.ServiceObjectives(this); this.elasticPoolActivities = new operations.ElasticPoolActivities(this); this.elasticPoolDatabaseActivities = new operations.ElasticPoolDatabaseActivities(this); - this.recommendedElasticPools = new operations.RecommendedElasticPools(this); this.serviceTierAdvisors = new operations.ServiceTierAdvisors(this); this.transparentDataEncryptions = new operations.TransparentDataEncryptions(this); this.transparentDataEncryptionActivities = new operations.TransparentDataEncryptionActivities(this); @@ -113,6 +112,7 @@ class SqlManagementClient extends ServiceClient { this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); this.elasticPoolOperations = new operations.ElasticPoolOperations(this); + this.capabilities = new operations.Capabilities(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/sqlManagement2/package.json b/lib/services/sqlManagement2/package.json index 1686f3a4fe..71add088c2 100644 --- a/lib/services/sqlManagement2/package.json +++ b/lib/services/sqlManagement2/package.json @@ -1,35 +1,22 @@ { "name": "azure-arm-sql", "author": "Microsoft Corporation", - "contributors": [ - "Moore, Jared" - ], - "version": "2.0.0", - "description": "Microsoft Azure SQL Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/sqlManagementClient.js", - "types": "./lib/sqlManagementClient.d.ts", - "license": "MIT", + "description": "SqlManagementClient Library with typescript type definitions for node", + "version": "3.0.0", "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/sqlManagementClient.js", + "types": "./lib/sqlManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" } }