From 3286088e96d7b2c6d334f9f959232a4c3e10dc06 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 20 Mar 2018 15:18:29 +0000 Subject: [PATCH 1/4] Generated from b40a8cfb810bb53c9c0f62983df28f7beae14d90 Merge branch 'master' into master --- .../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 +- .../models/databaseVulnerabilityAssessment.js | 107 + ...abaseVulnerabilityAssessmentScansExport.js | 83 + .../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 | 2647 +-- .../sqlManagement2/lib/models/index.js | 73 +- .../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/services/sqlManagement2/lib/models/sku.js | 87 + .../lib/models/sloUsageMetric.js | 12 +- .../lib/models/subscriptionUsage.js | 108 + .../lib/models/subscriptionUsageListResult.js | 69 + ...ilityAssessmentRecurringScansProperties.js | 79 + .../vulnerabilityAssessmentScanError.js | 62 + .../vulnerabilityAssessmentScanRecord.js | 156 + ...erabilityAssessmentScanRecordListResult.js | 69 + .../backupLongTermRetentionPolicies.js | 431 +- .../databaseAutomaticTuningOperations.js | 563 + .../lib/operations/databaseOperations.js | 4 +- .../databaseVulnerabilityAssessmentScans.js | 1448 ++ .../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 | 14613 +++++++++------- .../sqlManagement2/lib/operations/index.js | 18 +- .../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 | 23 +- .../sqlManagement2/lib/sqlManagementClient.js | 21 +- 62 files changed, 26020 insertions(+), 10658 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/databaseVulnerabilityAssessment.js create mode 100644 lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessmentScansExport.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/sku.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/models/vulnerabilityAssessmentRecurringScansProperties.js create mode 100644 lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanError.js create mode 100644 lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecord.js create mode 100644 lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecordListResult.js create mode 100644 lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js create mode 100644 lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentScans.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/databaseVulnerabilityAssessment.js b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js new file mode 100644 index 0000000000..1d1f3e0836 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js @@ -0,0 +1,107 @@ +/* + * 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 database vulnerability assessment. + * + * @extends models['ProxyResource'] + */ +class DatabaseVulnerabilityAssessment extends models['ProxyResource'] { + /** + * Create a DatabaseVulnerabilityAssessment. + * @member {string} [storageContainerPath] A blob storage container path to + * hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * @member {string} [storageContainerSasKey] A shared access signature (SAS + * Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. + * @member {object} [recurringScans] The recurring scans settings + * @member {boolean} [recurringScans.isEnabled] Recurring scans state. + * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that + * the schedule scan notification will be is sent to the subscription + * administrators. + * @member {array} [recurringScans.emails] Specifies an array of e-mail + * addresses to which the scan notification is sent. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DatabaseVulnerabilityAssessment + * + * @returns {object} metadata of DatabaseVulnerabilityAssessment + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseVulnerabilityAssessment', + type: { + name: 'Composite', + className: 'DatabaseVulnerabilityAssessment', + 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' + } + }, + storageContainerPath: { + required: false, + serializedName: 'properties.storageContainerPath', + type: { + name: 'String' + } + }, + storageContainerSasKey: { + required: false, + serializedName: 'properties.storageContainerSasKey', + type: { + name: 'String' + } + }, + recurringScans: { + required: false, + serializedName: 'properties.recurringScans', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentRecurringScansProperties' + } + } + } + } + }; + } +} + +module.exports = DatabaseVulnerabilityAssessment; diff --git a/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessmentScansExport.js b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessmentScansExport.js new file mode 100644 index 0000000000..0a46456038 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessmentScansExport.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'; + +const models = require('./index'); + +/** + * A database Vulnerability Assessment scan export resource. + * + * @extends models['ProxyResource'] + */ +class DatabaseVulnerabilityAssessmentScansExport extends models['ProxyResource'] { + /** + * Create a DatabaseVulnerabilityAssessmentScansExport. + * @member {string} [exportedReportLocation] Location of the exported report + * (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DatabaseVulnerabilityAssessmentScansExport + * + * @returns {object} metadata of DatabaseVulnerabilityAssessmentScansExport + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseVulnerabilityAssessmentScansExport', + type: { + name: 'Composite', + className: 'DatabaseVulnerabilityAssessmentScansExport', + 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' + } + }, + exportedReportLocation: { + required: false, + readOnly: true, + serializedName: 'properties.exportedReportLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseVulnerabilityAssessmentScansExport; 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..72bbdeabf9 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,727 +368,371 @@ 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. - */ -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. + * 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. * - * @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 ReplicationLink class. - * @constructor - * Represents a database replication link. + * 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] 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 + * 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} [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. + * @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 ServerCommunicationLink extends ProxyResource { - readonly state?: string; - partnerServer: string; - readonly location?: string; +export interface Database extends TrackedResource { 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 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 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 SloUsageMetric class. - * @constructor - * A Slo Usage Metric. - * - * @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. - */ -export interface SloUsageMetric { + 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 serviceLevelObjectiveId?: string; - readonly inRangeTimeRatio?: number; -} - -/** - * @class - * Initializes a new instance of the ServiceTierAdvisor class. - * @constructor - * Represents a Service Tier Advisor. - * - * @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; -} - -/** - * @class - * Initializes a new instance of the TransparentDataEncryption class. - * @constructor - * Represents a database transparent data encryption configuration. - * - * @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 OperationImpact class. - * @constructor - * The impact of an operation, both in absolute and relative terms. - * - * @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 OperationImpact { - readonly name?: string; - readonly unit?: string; - readonly changeValueAbsolute?: number; - readonly changeValueRelative?: number; -} - -/** - * @class - * Initializes a new instance of the RecommendedIndex class. - * @constructor - * Represents a database recommended index. - * - * @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 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[]; + 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 Database class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * Represents a database. + * Represents a database update. * - * @member {string} [kind] Kind of database. This is metadata used for the - * Azure portal experience. + * @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 @@ -1171,9 +803,10 @@ export interface RecommendedIndex extends ProxyResource { * 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 @@ -1188,20 +821,37 @@ export interface RecommendedIndex extends ProxyResource { * 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. 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', + * 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 @@ -1225,9 +875,12 @@ export interface RecommendedIndex extends ProxyResource { * 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 Database extends TrackedResource { - readonly kind?: string; +export interface DatabaseUpdate extends Resource { + tags?: { [propertyName: string]: string }; collation?: string; readonly creationDate?: Date; readonly containmentState?: number; @@ -1253,6 +906,148 @@ export interface Database extends TrackedResource { 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 ElasticPoolDatabaseActivity class. + * @constructor + * Represents the activity on an elastic pool. + * + * @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 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 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 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; } /** @@ -1280,18 +1075,151 @@ export interface Database extends TrackedResource { * @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?: Database[]; - readonly metrics?: RecommendedElasticPoolMetric[]; +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 DatabaseSecurityAlertPolicy class. + * @constructor + * Contains information about a database Threat Detection policy. + * + * @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 DataMaskingPolicy class. + * @constructor + * Represents a database data masking policy. + * + * @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; } /** @@ -1313,6 +1241,9 @@ export interface RecommendedElasticPool extends ProxyResource { * 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. */ @@ -1324,6 +1255,7 @@ export interface ElasticPool extends TrackedResource { databaseDtuMax?: number; databaseDtuMin?: number; storageMB?: number; + zoneRedundant?: boolean; readonly kind?: string; } @@ -1347,6 +1279,9 @@ export interface ElasticPool extends 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. */ export interface ElasticPoolUpdate extends Resource { tags?: { [propertyName: string]: string }; @@ -1357,290 +1292,372 @@ export interface ElasticPoolUpdate extends Resource { databaseDtuMax?: number; databaseDtuMin?: number; storageMB?: number; + zoneRedundant?: boolean; } /** * @class - * Initializes a new instance of the ElasticPoolActivity class. + * Initializes a new instance of the FirewallRule class. * @constructor - * Represents the activity on an elastic pool. + * Represents a server firewall rule. * - * @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} [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 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 MetricName { + readonly value?: string; + readonly localizedValue?: string; } /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the Metric class. * @constructor - * Represents the activity on an elastic pool. + * Database 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 {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 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 Metric { readonly startTime?: Date; - readonly state?: string; + readonly endTime?: Date; + readonly timeGrain?: string; + readonly unit?: string; + readonly name?: MetricName; + readonly metricValues?: MetricValue[]; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the MetricAvailability 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. + * A metric availability value. * - * 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} [retention] The length of retention for the database + * metric. + * @member {string} [timeGrain] The granularity of the database metric. */ -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 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 TransparentDataEncryptionActivity class. + * Initializes a new instance of the ReplicationLink class. * @constructor - * Represents a database transparent data encryption Scan. + * Represents a database replication 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} [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 TransparentDataEncryptionActivity extends ProxyResource { +export interface ReplicationLink extends ProxyResource { readonly location?: string; - readonly status?: 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; } /** @@ -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. @@ -2259,76 +2318,255 @@ export interface SyncGroupSchema { * @member {string} [schema.masterSyncMemberName] Name of master sync member * where the schema is from. */ -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 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 SyncMember class. + * @constructor + * An Azure SQL Database sync member. + * + * @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 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 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. + * @constructor + * A virtual network rule. + * + * @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 VirtualNetworkRule extends ProxyResource { + virtualNetworkSubnetId: string; + ignoreMissingVnetServiceEndpoint?: boolean; + 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 SyncMember class. + * Initializes a new instance of the RestorePoint class. * @constructor - * An Azure SQL Database sync member. + * Database restore points. * - * @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} [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 SyncMember extends ProxyResource { - databaseType?: string; - syncAgentId?: string; - sqlServerDatabaseId?: string; - serverName?: string; - databaseName?: string; - userName?: string; - password?: string; - syncDirection?: string; - readonly syncState?: string; +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 VirtualNetworkRule class. + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. * @constructor - * A virtual network rule. + * Contains the information necessary to perform a create database restore + * point operation. * - * @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} restorePointLabel The restore point label to apply */ -export interface VirtualNetworkRule extends ProxyResource { - virtualNetworkSubnetId: string; - ignoreMissingVnetServiceEndpoint?: boolean; - readonly state?: string; +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; } /** @@ -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,67 +2607,218 @@ 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 ElasticPoolOperation 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. + */ +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 RestorePointListResult class. + * Initializes a new instance of the Sku class. * @constructor - * The response to a list database restore points request. + * An ARM Resource 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. */ -export interface RestorePointListResult extends Array { +export interface Sku { + name?: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; } /** * @class - * Initializes a new instance of the RecoverableDatabaseListResult class. + * Initializes a new instance of the VulnerabilityAssessmentRecurringScansProperties class. * @constructor - * The response to a list recoverable databases request + * Properties of a Vulnerability Assessment recurring scans. * + * @member {boolean} [isEnabled] Recurring scans state. + * @member {boolean} [emailSubscriptionAdmins] Specifies that the schedule scan + * notification will be is sent to the subscription administrators. Default + * value: true . + * @member {array} [emails] Specifies an array of e-mail addresses to which the + * scan notification is sent. */ -export interface RecoverableDatabaseListResult extends Array { +export interface VulnerabilityAssessmentRecurringScansProperties { + isEnabled?: boolean; + emailSubscriptionAdmins?: boolean; + emails?: string[]; } /** * @class - * Initializes a new instance of the RestorableDroppedDatabaseListResult class. + * Initializes a new instance of the DatabaseVulnerabilityAssessment class. * @constructor - * The response to a list restorable dropped databases request + * A database vulnerability assessment. * + * @member {string} [storageContainerPath] A blob storage container path to + * hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * @member {string} [storageContainerSasKey] A shared access signature (SAS + * Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. + * @member {object} [recurringScans] The recurring scans settings + * @member {boolean} [recurringScans.isEnabled] Recurring scans state. + * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that + * the schedule scan notification will be is sent to the subscription + * administrators. + * @member {array} [recurringScans.emails] Specifies an array of e-mail + * addresses to which the scan notification is sent. */ -export interface RestorableDroppedDatabaseListResult extends Array { +export interface DatabaseVulnerabilityAssessment extends ProxyResource { + storageContainerPath?: string; + storageContainerSasKey?: string; + recurringScans?: VulnerabilityAssessmentRecurringScansProperties; } /** * @class - * Initializes a new instance of the DataMaskingRuleListResult class. + * Initializes a new instance of the VulnerabilityAssessmentScanError class. * @constructor - * The response to a list data masking rules request. + * Properties of a vulnerability assessment scan error. * + * @member {string} [code] The error code. + * @member {string} [message] The error message. */ -export interface DataMaskingRuleListResult extends Array { +export interface VulnerabilityAssessmentScanError { + readonly code?: string; + readonly message?: string; } /** * @class - * Initializes a new instance of the FirewallRuleListResult class. + * Initializes a new instance of the VulnerabilityAssessmentScanRecord class. * @constructor - * Represents the response to a List Firewall Rules request. + * A vulnerability assessment scan record. * + * @member {string} [scanId] The scan ID. + * @member {string} [triggerType] The scan trigger type. Possible values + * include: 'OnDemand', 'Recurring' + * @member {string} [state] The scan status. Possible values include: 'Passed', + * 'Failed', 'FailedToRun', 'InProgress' + * @member {date} [startTime] The scan start time (UTC). + * @member {date} [endTime] The scan end time (UTC). + * @member {array} [errors] The scan errors. + * @member {string} [storageContainerPath] The scan results storage container + * path. + * @member {number} [numberOfFailedSecurityChecks] The number of failed + * security checks. */ -export interface FirewallRuleListResult extends Array { +export interface VulnerabilityAssessmentScanRecord extends ProxyResource { + readonly scanId?: string; + readonly triggerType?: string; + readonly state?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly errors?: VulnerabilityAssessmentScanError[]; + readonly storageContainerPath?: string; + readonly numberOfFailedSecurityChecks?: number; } /** * @class - * Initializes a new instance of the GeoBackupPolicyListResult class. + * Initializes a new instance of the DatabaseVulnerabilityAssessmentScansExport class. * @constructor - * The response to a list geo backup policies request. + * A database Vulnerability Assessment scan export resource. * + * @member {string} [exportedReportLocation] Location of the exported report + * (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). */ -export interface GeoBackupPolicyListResult extends Array { +export interface DatabaseVulnerabilityAssessmentScansExport extends ProxyResource { + readonly exportedReportLocation?: string; +} + + +/** + * @class + * Initializes a new instance of the RecoverableDatabaseListResult class. + * @constructor + * The response to a list recoverable databases request + * + */ +export interface RecoverableDatabaseListResult extends Array { +} + +/** + * @class + * Initializes a new instance of the RestorableDroppedDatabaseListResult class. + * @constructor + * The response to a list restorable dropped databases request + * + */ +export interface RestorableDroppedDatabaseListResult 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 DatabaseListResult class. + * @constructor + * Represents the response to a list database request. + * + */ +export interface DatabaseListResult extends Array { } /** @@ -2450,12 +2843,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 +2861,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 +2921,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 +3134,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 +3158,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 +3205,27 @@ 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; +} + +/** + * @class + * Initializes a new instance of the VulnerabilityAssessmentScanRecordListResult class. + * @constructor + * A list of vulnerability assessment scan records. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface VulnerabilityAssessmentScanRecordListResult 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..1d58d1b5e3 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,39 @@ 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.Sku = require('./sku'); +exports.VulnerabilityAssessmentRecurringScansProperties = require('./vulnerabilityAssessmentRecurringScansProperties'); +exports.DatabaseVulnerabilityAssessment = require('./databaseVulnerabilityAssessment'); +exports.VulnerabilityAssessmentScanError = require('./vulnerabilityAssessmentScanError'); +exports.VulnerabilityAssessmentScanRecord = require('./vulnerabilityAssessmentScanRecord'); +exports.DatabaseVulnerabilityAssessmentScansExport = require('./databaseVulnerabilityAssessmentScansExport'); 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 +149,11 @@ 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'); +exports.VulnerabilityAssessmentScanRecordListResult = require('./vulnerabilityAssessmentScanRecordListResult'); 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/sku.js b/lib/services/sqlManagement2/lib/models/sku.js new file mode 100644 index 0000000000..b0e24e9236 --- /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: false, + 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/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/models/vulnerabilityAssessmentRecurringScansProperties.js b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentRecurringScansProperties.js new file mode 100644 index 0000000000..b08942b1ca --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentRecurringScansProperties.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Properties of a Vulnerability Assessment recurring scans. + * + */ +class VulnerabilityAssessmentRecurringScansProperties { + /** + * Create a VulnerabilityAssessmentRecurringScansProperties. + * @member {boolean} [isEnabled] Recurring scans state. + * @member {boolean} [emailSubscriptionAdmins] Specifies that the schedule + * scan notification will be is sent to the subscription administrators. + * Default value: true . + * @member {array} [emails] Specifies an array of e-mail addresses to which + * the scan notification is sent. + */ + constructor() { + } + + /** + * Defines the metadata of VulnerabilityAssessmentRecurringScansProperties + * + * @returns {object} metadata of VulnerabilityAssessmentRecurringScansProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'VulnerabilityAssessmentRecurringScansProperties', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentRecurringScansProperties', + modelProperties: { + isEnabled: { + required: false, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + emailSubscriptionAdmins: { + required: false, + serializedName: 'emailSubscriptionAdmins', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + emails: { + required: false, + serializedName: 'emails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = VulnerabilityAssessmentRecurringScansProperties; diff --git a/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanError.js b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanError.js new file mode 100644 index 0000000000..29ed29a2d7 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanError.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'; + +/** + * Properties of a vulnerability assessment scan error. + * + */ +class VulnerabilityAssessmentScanError { + /** + * Create a VulnerabilityAssessmentScanError. + * @member {string} [code] The error code. + * @member {string} [message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of VulnerabilityAssessmentScanError + * + * @returns {object} metadata of VulnerabilityAssessmentScanError + * + */ + mapper() { + return { + required: false, + serializedName: 'VulnerabilityAssessmentScanError', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentScanError', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VulnerabilityAssessmentScanError; diff --git a/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecord.js b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecord.js new file mode 100644 index 0000000000..cbef4bb19f --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecord.js @@ -0,0 +1,156 @@ +/* + * 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 vulnerability assessment scan record. + * + * @extends models['ProxyResource'] + */ +class VulnerabilityAssessmentScanRecord extends models['ProxyResource'] { + /** + * Create a VulnerabilityAssessmentScanRecord. + * @member {string} [scanId] The scan ID. + * @member {string} [triggerType] The scan trigger type. Possible values + * include: 'OnDemand', 'Recurring' + * @member {string} [state] The scan status. Possible values include: + * 'Passed', 'Failed', 'FailedToRun', 'InProgress' + * @member {date} [startTime] The scan start time (UTC). + * @member {date} [endTime] The scan end time (UTC). + * @member {array} [errors] The scan errors. + * @member {string} [storageContainerPath] The scan results storage container + * path. + * @member {number} [numberOfFailedSecurityChecks] The number of failed + * security checks. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VulnerabilityAssessmentScanRecord + * + * @returns {object} metadata of VulnerabilityAssessmentScanRecord + * + */ + mapper() { + return { + required: false, + serializedName: 'VulnerabilityAssessmentScanRecord', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentScanRecord', + 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' + } + }, + scanId: { + required: false, + readOnly: true, + serializedName: 'properties.scanId', + type: { + name: 'String' + } + }, + triggerType: { + required: false, + readOnly: true, + serializedName: 'properties.triggerType', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + errors: { + required: false, + readOnly: true, + serializedName: 'properties.errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VulnerabilityAssessmentScanErrorElementType', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentScanError' + } + } + } + }, + storageContainerPath: { + required: false, + readOnly: true, + serializedName: 'properties.storageContainerPath', + type: { + name: 'String' + } + }, + numberOfFailedSecurityChecks: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfFailedSecurityChecks', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = VulnerabilityAssessmentScanRecord; diff --git a/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecordListResult.js b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecordListResult.js new file mode 100644 index 0000000000..04d5447c1b --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/vulnerabilityAssessmentScanRecordListResult.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 vulnerability assessment scan records. + */ +class VulnerabilityAssessmentScanRecordListResult extends Array { + /** + * Create a VulnerabilityAssessmentScanRecordListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VulnerabilityAssessmentScanRecordListResult + * + * @returns {object} metadata of VulnerabilityAssessmentScanRecordListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'VulnerabilityAssessmentScanRecordListResult', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentScanRecordListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VulnerabilityAssessmentScanRecordElementType', + type: { + name: 'Composite', + className: 'VulnerabilityAssessmentScanRecord' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VulnerabilityAssessmentScanRecordListResult; 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/databaseVulnerabilityAssessmentScans.js b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentScans.js new file mode 100644 index 0000000000..a710edfb82 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentScans.js @@ -0,0 +1,1448 @@ +/* + * 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 vulnerability assessment scan record of 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 {string} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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 VulnerabilityAssessmentScanRecord} 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, scanId, 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 vulnerabilityAssessmentName = 'default'; + 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 (scanId === null || scanId === undefined || typeof scanId.valueOf() !== 'string') { + throw new Error('scanId 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{vulnerabilityAssessmentName}', encodeURIComponent(vulnerabilityAssessmentName)); + requestUrl = requestUrl.replace('{scanId}', encodeURIComponent(scanId)); + 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['VulnerabilityAssessmentScanRecord']().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); + }); +} + + +/** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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 _execute(resourceGroupName, serverName, databaseName, scanId, 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.beginExecute(resourceGroupName, serverName, databaseName, scanId, 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 the vulnerability assessment scans of 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. + * + * @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 VulnerabilityAssessmentScanRecordListResult} + * 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 vulnerabilityAssessmentName = 'default'; + 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{vulnerabilityAssessmentName}', encodeURIComponent(vulnerabilityAssessmentName)); + 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['VulnerabilityAssessmentScanRecordListResult']().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); + }); +} + +/** + * Convert an existing scan result to a human readable format. If already + * exists nothing happens + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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 scanned database. + * + * @param {string} scanId The vulnerability assessment scan Id. + * + * @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 DatabaseVulnerabilityAssessmentScansExport} + * 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, scanId, 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 vulnerabilityAssessmentName = 'default'; + 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 (scanId === null || scanId === undefined || typeof scanId.valueOf() !== 'string') { + throw new Error('scanId 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{vulnerabilityAssessmentName}', encodeURIComponent(vulnerabilityAssessmentName)); + requestUrl = requestUrl.replace('{scanId}', encodeURIComponent(scanId)); + 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 !== 201) { + 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['DatabaseVulnerabilityAssessmentScansExport']().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['DatabaseVulnerabilityAssessmentScansExport']().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); + }); +} + +/** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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 _beginExecute(resourceGroupName, serverName, databaseName, scanId, 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 vulnerabilityAssessmentName = 'default'; + 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 (scanId === null || scanId === undefined || typeof scanId.valueOf() !== 'string') { + throw new Error('scanId 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{vulnerabilityAssessmentName}', encodeURIComponent(vulnerabilityAssessmentName)); + requestUrl = requestUrl.replace('{scanId}', encodeURIComponent(scanId)); + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the vulnerability assessment scans of 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 VulnerabilityAssessmentScanRecordListResult} + * 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['VulnerabilityAssessmentScanRecordListResult']().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 DatabaseVulnerabilityAssessmentScans. */ +class DatabaseVulnerabilityAssessmentScans { + /** + * Create a DatabaseVulnerabilityAssessmentScans. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._execute = _execute; + this._listByDatabase = _listByDatabase; + this._exportMethod = _exportMethod; + this._beginExecute = _beginExecute; + this._listByDatabaseNext = _listByDatabaseNext; + } + + /** + * Gets a vulnerability assessment scan record of 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 {string} scanId The vulnerability assessment scan Id of the scan 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} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, scanId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, scanId, 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 vulnerability assessment scan record of 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 {string} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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 {VulnerabilityAssessmentScanRecord} - 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 VulnerabilityAssessmentScanRecord} 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, scanId, 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, scanId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, scanId, options, optionalCallback); + } + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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} - The error object. + */ + executeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, scanId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._execute(resourceGroupName, serverName, databaseName, scanId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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. + */ + execute(resourceGroupName, serverName, databaseName, scanId, 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._execute(resourceGroupName, serverName, databaseName, scanId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._execute(resourceGroupName, serverName, databaseName, scanId, options, optionalCallback); + } + } + + /** + * Lists the vulnerability assessment scans of 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. + * + * @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; + }); + }); + } + + /** + * Lists the vulnerability assessment scans of 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. + * + * @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 {VulnerabilityAssessmentScanRecordListResult} - 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 VulnerabilityAssessmentScanRecordListResult} + * 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); + } + } + + /** + * Convert an existing scan result to a human readable format. If already + * exists nothing happens + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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 scanned database. + * + * @param {string} scanId The vulnerability assessment scan Id. + * + * @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, scanId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportMethod(resourceGroupName, serverName, databaseName, scanId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Convert an existing scan result to a human readable format. If already + * exists nothing happens + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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 scanned database. + * + * @param {string} scanId The vulnerability assessment scan Id. + * + * @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 {DatabaseVulnerabilityAssessmentScansExport} - 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 DatabaseVulnerabilityAssessmentScansExport} + * 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, scanId, 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, scanId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportMethod(resourceGroupName, serverName, databaseName, scanId, options, optionalCallback); + } + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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} - The error object. + */ + beginExecuteWithHttpOperationResponse(resourceGroupName, serverName, databaseName, scanId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginExecute(resourceGroupName, serverName, databaseName, scanId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * + * @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. + */ + beginExecute(resourceGroupName, serverName, databaseName, scanId, 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._beginExecute(resourceGroupName, serverName, databaseName, scanId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginExecute(resourceGroupName, serverName, databaseName, scanId, options, optionalCallback); + } + } + + /** + * Lists the vulnerability assessment scans of 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 the vulnerability assessment scans of 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 {VulnerabilityAssessmentScanRecordListResult} - 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 VulnerabilityAssessmentScanRecordListResult} + * 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); + } + } + +} + +module.exports = DatabaseVulnerabilityAssessmentScans; 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..b31cbf2662 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,3638 @@ 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, 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. + */ + 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. + * + * @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 + * + * @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, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates 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 + * 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 + * ElasticPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPools { + + + /** + * 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|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 @@ -1742,18 +5169,34 @@ 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 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 The required parameters for creating or updating - * a firewall rule. + * @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.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.tags] Resource tags. * - * @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.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1767,7 +5210,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. * @@ -1775,20 +5218,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; + 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; /** - * Deletes a firewall rule. + * 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 @@ -1796,7 +5239,31 @@ 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 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. * @@ -1805,14 +5272,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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a firewall rule. + * 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 @@ -1820,7 +5287,31 @@ 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 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. * @@ -1834,7 +5325,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1842,19 +5333,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. + * {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. */ - 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; + 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 firewall rule. + * 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 @@ -1862,7 +5354,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 to be deleted. * * @param {object} [options] Optional Parameters. * @@ -1871,14 +5363,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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a firewall rule. + * 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 @@ -1886,7 +5378,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 to be deleted. * * @param {object} [options] Optional Parameters. * @@ -1900,7 +5392,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1908,20 +5400,19 @@ 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. + * {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, 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; + 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 firewall rules. + * 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 @@ -1929,6 +5420,9 @@ export interface FirewallRules { * * @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 @@ -1936,14 +5430,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of firewall rules. + * 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 @@ -1951,6 +5445,9 @@ export interface FirewallRules { * * @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 @@ -1963,7 +5460,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,30 +5468,20 @@ 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 { + 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; /** - * Updates a database geo backup policy. + * 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 @@ -2002,14 +5489,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2017,14 +5496,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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database geo backup policy. + * 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 @@ -2032,14 +5511,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2052,7 +5523,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2060,20 +5531,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. + * {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. */ - 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; + 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 geo backup policy. + * 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 @@ -2081,7 +5552,10 @@ 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. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -2090,14 +5564,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>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a geo backup policy. + * 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 @@ -2105,7 +5579,10 @@ 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. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -2119,7 +5596,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {MetricListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2127,20 +5604,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. + * {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. */ - 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; + 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; /** - * Returns a list of geo backup policies. + * 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 @@ -2148,7 +5625,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. * * @param {object} [options] Optional Parameters. * @@ -2157,14 +5634,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>; + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of geo backup policies. + * 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 @@ -2172,7 +5649,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. * * @param {object} [options] Optional Parameters. * @@ -2186,7 +5663,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicyListResult} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2194,30 +5671,21 @@ 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 + * {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. */ - 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 { + 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; /** - * Imports a bacpac into a new database. + * 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 @@ -2225,39 +5693,34 @@ 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} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). * - * @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 {object} parameters The required parameters for creating or updating + * an elastic pool. * - * @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.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @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.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. * @@ -2266,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. */ - importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Imports a bacpac into a new database. + * 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 @@ -2281,39 +5744,34 @@ 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} elasticPoolName The name of the elastic pool to be operated + * on (updated or created). * - * @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 {object} parameters The required parameters for creating or updating + * an elastic pool. * - * @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.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @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.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. * @@ -2327,7 +5785,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2335,21 +5793,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. + * {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. */ - 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; + 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; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -2357,31 +5814,31 @@ 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} elasticPoolName The name of the elastic pool to be updated. * - * @param {string} [parameters.name] The name of the extension. + * @param {object} parameters The required parameters for updating an elastic + * pool. * - * @param {string} [parameters.type] The type of the extension. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @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. * @@ -2390,15 +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. */ - createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -2406,31 +5862,31 @@ 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} elasticPoolName The name of the elastic pool to be updated. * - * @param {string} [parameters.name] The name of the extension. + * @param {object} parameters The required parameters for updating an elastic + * pool. * - * @param {string} [parameters.type] The type of the extension. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.edition] The edition of the elastic pool. + * Possible values include: 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {number} [parameters.dtu] The total shared DTU for the database + * elastic pool. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database + * can consume. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases + * are guaranteed. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {number} [parameters.storageMB] Gets storage limit for the database + * elastic pool in MB. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @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. * @@ -2444,7 +5900,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2452,20 +5908,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. + * {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. */ - 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; + 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 { /** - * Exports a database to a bacpac. + * 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 @@ -2473,26 +5938,18 @@ 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} firewallRuleName The name of the firewall rule. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @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.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @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. * @@ -2501,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. */ - exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * 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 @@ -2516,26 +5973,18 @@ 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} firewallRuleName The name of the firewall rule. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @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.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @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. * @@ -2549,7 +5998,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2557,20 +6006,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. + * {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. */ - 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; + 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; /** - * Returns database metrics. + * 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 @@ -2578,10 +6027,7 @@ 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 {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2590,14 +6036,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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metrics. + * 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 @@ -2605,10 +6051,7 @@ 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 {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2622,7 +6065,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2630,20 +6073,19 @@ 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. + * {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, 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; + 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; /** - * Returns database metric definitions. + * 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 @@ -2651,7 +6093,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2660,14 +6102,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, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metric definitions. + * 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 @@ -2675,7 +6117,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2689,7 +6131,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2697,21 +6139,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. + * {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. */ - 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, 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; /** - * Pauses a data warehouse. + * 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 @@ -2719,8 +6160,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 @@ -2728,14 +6167,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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * 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 @@ -2743,8 +6182,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 @@ -2757,7 +6194,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FirewallRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2765,19 +6202,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. + * {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. */ - 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; + 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 { /** - * Resumes a data warehouse. + * 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 @@ -2785,7 +6233,13 @@ 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} 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 {object} [options] Optional Parameters. * @@ -2794,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. */ - resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * 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 @@ -2809,7 +6263,13 @@ 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} 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 {object} [options] Optional Parameters. * @@ -2823,7 +6283,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2831,19 +6291,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. + * {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. */ - 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.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; /** - * Creates a new database or updates an existing database. + * 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 @@ -2851,130 +6312,7 @@ 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.". 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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2983,14 +6321,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * 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 @@ -2998,130 +6336,74 @@ 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} databaseName The name of the database. * - * @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. * - * 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 {GeoBackupPolicy} - 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|ServiceError} - 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. + * {ServiceCallback} 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|ServiceError} 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' + * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link GeoBackupPolicy} 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. + * {WebResource} [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. + * {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; + + + /** + * Returns a list of geo backup policies. * - * @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} databaseName The name of the 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 {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. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns a list of geo backup policies. * - * @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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3135,7 +6417,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {GeoBackupPolicyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3143,20 +6425,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. + * {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. */ - 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; + 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 { /** - * Updates an existing 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 @@ -3164,126 +6456,81 @@ 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 that has the + * replication link to be dropped. * - * @param {object} parameters The required parameters for updating a database. + * @param {string} linkId The ID of the replication link to be deleted. * - * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a database replication link. Cannot be done during failover. * - * 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 that has the + * replication link to be dropped. * - * 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} linkId The ID of the replication link to be deleted. * - * 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, 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; + + + /** + * Gets a database replication 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} databaseName The name of the database to get the link for. + * + * @param {string} linkId The replication link ID to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -3292,14 +6539,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * 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 @@ -3307,126 +6554,84 @@ 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 get the link for. * - * @param {object} parameters The required parameters for updating a database. + * @param {string} linkId The replication link ID to be retrieved. * - * @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. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * Default: regular database creation. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * {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 {ReplicationLink} - 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. + * {ReplicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicationLink} 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. + */ + 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; + + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. * - * @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 that has the + * replication link to be failed over. * - * @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} linkId The ID of the replication link to be failed over. * - * @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. + */ + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets which replica database is primary by failing over from the current + * primary replica 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} resourceGroupName The name of the resource group that + * contains the 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 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. * @@ -3440,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. * @@ -3448,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. */ - 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; + 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; /** - * Deletes a 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 @@ -3469,7 +6674,10 @@ 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 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. * @@ -3482,10 +6690,11 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a 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 @@ -3493,7 +6702,10 @@ 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 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. * @@ -3521,13 +6733,13 @@ export interface Databases { * * {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; + 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. + * 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 @@ -3535,27 +6747,23 @@ 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 to retrieve links for. * * @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>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database. + * 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 @@ -3563,14 +6771,10 @@ 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 to retrieve links for. * * @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 * @@ -3581,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. * @@ -3589,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. */ - 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; + 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 in a server. + * 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 @@ -3610,28 +6816,27 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} linkId The ID of the replication link to be failed over. * - * @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>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in a server. + * 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 @@ -3639,14 +6844,12 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} linkId The ID of the replication link to be failed over. * - * @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 +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. * @@ -3666,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. */ - 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; + 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; /** - * Gets a database inside of 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 @@ -3687,10 +6890,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 +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. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverAllowDataLossWithHttpOperationResponse(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. 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 @@ -3714,10 +6918,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 +6935,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 +6943,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. + * {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; + 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 { /** - * Returns a list of databases in an elastic pool. + * 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 @@ -3760,8 +6973,15 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @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. * @@ -3770,14 +6990,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in an elastic pool. + * 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 @@ -3785,8 +7006,15 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @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. * @@ -3800,7 +7028,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3808,20 +7036,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. + * {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. */ - 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; + 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; /** - * Gets a database inside of a recommented elastic pool. + * 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 @@ -3829,11 +7058,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3841,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. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of a recommented elastic pool. + * 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 @@ -3856,11 +7080,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3873,7 +7092,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. * @@ -3881,20 +7100,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. + * {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. */ - 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; + 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; /** - * Returns a list of databases inside a recommented elastic pool. + * 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 @@ -3902,9 +7122,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3912,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. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases inside a recommented elastic pool. + * 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 @@ -3927,9 +7144,6 @@ 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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3942,7 +7156,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3950,20 +7164,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. + * {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. */ - 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; + 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; /** - * Imports a bacpac into a new database. + * 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 @@ -3971,40 +7186,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 @@ -4012,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. */ - beginImportMethodWithHttpOperationResponse(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 server Administrators. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4027,40 +7208,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 @@ -4073,7 +7220,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {ServerAdministratorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4081,21 +7228,22 @@ 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. + * {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. */ - 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; + 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. + * 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 +7251,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,15 +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. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(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. + * 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 @@ -4152,31 +7284,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. * @@ -4190,7 +7306,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 +7314,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; + 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; /** - * 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 +7336,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 +7343,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>; + beginDeleteMethodWithHttpOperationResponse(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 +7358,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 +7370,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 +7378,30 @@ 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; + 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 { /** - * Pauses a data warehouse. + * 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 @@ -4324,7 +7409,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} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -4337,10 +7423,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * 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 @@ -4348,7 +7434,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} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -4376,13 +7463,13 @@ export interface Databases { * * {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; + 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; /** - * Resumes a data warehouse. + * 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 @@ -4390,7 +7477,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -4399,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. */ - beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * 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 @@ -4414,7 +7502,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -4428,7 +7517,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4436,19 +7525,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. + * {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. */ - 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; + 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 new database or updates an existing database. + * 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 @@ -4456,130 +7547,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} communicationLinkName The name of the server communication + * link. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} parameters The required parameters for creating a server + * communication link. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} parameters.partnerServer The name of the partner server. * - * @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. + * @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. * - * 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. + * + * @param {string} serverName The name of the server. + * + * @param {string} communicationLinkName The name of the server communication + * link. * - * 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 creating a 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 {string} parameters.partnerServer The name of the partner server. * - * 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] Optional Parameters. * - * @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.customHeaders] Headers that will be added to the + * request * - * @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 {ServiceCallback} [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 {ServiceCallback|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 {ServerCommunicationLink} - 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|ServiceError} - 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." + * {ServiceCallback} 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|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. + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} 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, 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; + + + /** + * Gets a list of server communication links. * - * @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. * @@ -4588,14 +7634,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * 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 @@ -4603,130 +7649,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 {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 {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 {ServerCommunicationLinkListResult} - 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. + * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLinkListResult} 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. + */ + 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} [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. + */ + beginCreateOrUpdateWithHttpOperationResponse(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 {object} [parameters.tags] Resource tags. + * @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.location Resource location. + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -4740,7 +7741,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. * @@ -4748,20 +7749,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. + * {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, 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; + 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 { /** - * Updates an existing database. + * 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 @@ -4769,126 +7780,8 @@ 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.". 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} serviceObjectiveName The name of the service objective to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -4897,14 +7790,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, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * 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 @@ -4912,126 +7805,71 @@ 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. + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. * - * 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 {ServiceObjective} - 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. + * {ServiceObjective} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjective} 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. + */ + 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 {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 {object} [options] Optional Parameters. * - * @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} [options.customHeaders] Headers that will be added to the + * request * - * @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' + * @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. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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. * @@ -5045,7 +7883,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ServiceObjectiveListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5053,29 +7891,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. + * {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. */ - 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; + 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 - * ElasticPools + * ElasticPoolActivities * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ElasticPools { +export interface ElasticPoolActivities { /** - * Returns elastic pool metrics. + * 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 @@ -5083,10 +7922,8 @@ 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 {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5095,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. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metrics. + * 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 @@ -5110,10 +7947,8 @@ 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 {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5127,7 +7962,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ElasticPoolActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5135,20 +7970,30 @@ 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. + * {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. */ - 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; + 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 elastic pool metric definitions. + * 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 @@ -5165,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. */ - listMetricDefinitionsWithHttpOperationResponse(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>; /** - * Returns elastic pool metric definitions. + * 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 @@ -5194,7 +8039,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5202,21 +8047,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 - * 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. */ - 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; + 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 { /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5224,30 +8078,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} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5256,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5271,30 +8103,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} recommendedElasticPoolName The name of the recommended + * elastic pool to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -5308,7 +8118,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {RecommendedElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5316,20 +8126,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. + * {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, 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, 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; /** - * 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 @@ -5337,27 +8148,72 @@ 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} [options] Optional Parameters. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @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.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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 {RecommendedElasticPoolListResult} - 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. + * + * {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. + */ + 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 recommented elastic pool metrics. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU 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 {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} serverName The name of the server. * - * @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. * @@ -5366,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. */ - updateWithHttpOperationResponse(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 @@ -5381,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. * @@ -5415,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. * @@ -5423,20 +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. */ - 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; + 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 { /** - * Deletes the elastic pool. + * 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 @@ -5444,7 +8291,9 @@ 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} databaseName The name of database. + * + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5453,14 +8302,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the elastic pool. + * 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 @@ -5468,7 +8317,9 @@ 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} databaseName The name of database. + * + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5482,7 +8333,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceTierAdvisor} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5490,19 +8341,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. + * {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, 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; + 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 an elastic pool. + * 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 @@ -5510,8 +8362,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} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -5520,14 +8371,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>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an elastic pool. + * 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 @@ -5535,8 +8386,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} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -5550,7 +8400,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5558,20 +8408,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. + * {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, 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; + 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 { /** - * Returns a list of elastic pools in a server. + * 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 @@ -5579,6 +8439,15 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. + * + * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5586,14 +8455,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of elastic pools in a server. + * 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 @@ -5601,6 +8470,15 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. + * + * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5613,7 +8491,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5621,20 +8499,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. + * {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. */ - 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, 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; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5642,30 +8521,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} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -5674,14 +8531,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5689,30 +8546,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} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -5726,7 +8561,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5734,20 +8569,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. + * {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. */ - 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; + 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 { /** - * Updates an existing elastic pool. + * 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 @@ -5755,27 +8600,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} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -5784,14 +8610,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>; + listByConfigurationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * 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 @@ -5799,27 +8625,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} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -5833,7 +8640,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5841,29 +8648,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. + * {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. */ - 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; + 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 - * ReplicationLinks + * ServerUsages * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ReplicationLinks { +export interface ServerUsages { /** - * Deletes a database replication link. Cannot be done during failover. + * 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 @@ -5871,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 dropped. - * - * @param {string} linkId The ID of the replication link to be deleted. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5883,14 +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. */ - deleteMethodWithHttpOperationResponse(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>; /** - * Deletes a database replication link. Cannot be done during failover. + * 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 @@ -5898,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 dropped. - * - * @param {string} linkId The ID of the replication link to be deleted. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5915,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. * @@ -5923,19 +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. */ - 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; + 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 { /** - * Gets a database replication link. + * 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 @@ -5943,9 +8751,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 the database. * * @param {object} [options] Optional Parameters. * @@ -5954,14 +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. */ - 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 database usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5969,9 +8775,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 the database. * * @param {object} [options] Optional Parameters. * @@ -5985,7 +8789,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLink} - The deserialized result object. + * @resolve {DatabaseUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5993,21 +8797,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. + * {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. */ - 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 + * DatabaseBlobAuditingPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseBlobAuditingPolicies { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * 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 @@ -6015,10 +8828,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 blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -6027,15 +8838,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>; + 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. + * 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 @@ -6043,10 +8853,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 blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -6060,7 +8868,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6068,20 +8876,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. + * {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. */ - 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; + 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; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * 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 @@ -6089,10 +8898,34 @@ 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 the blob + * auditing policy will be defined. * - * @param {string} linkId The ID of the replication link to be failed over. + * @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. * @@ -6101,15 +8934,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, 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. + * 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 @@ -6117,10 +8949,34 @@ 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 the blob + * auditing policy will be defined. * - * @param {string} linkId The ID of the replication link to be failed over. + * @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. * @@ -6134,7 +8990,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6142,19 +8998,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. + * {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. */ - 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; + 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 { /** - * Lists a database's replication links. + * 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 @@ -6162,7 +9029,7 @@ 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. * * @param {object} [options] Optional Parameters. * @@ -6171,14 +9038,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists a database's replication links. + * 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 @@ -6186,7 +9053,7 @@ 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. * * @param {object} [options] Optional Parameters. * @@ -6200,7 +9067,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLinkListResult} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6208,22 +9075,21 @@ 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 + * {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. */ - 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; + 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; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * 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 @@ -6231,10 +9097,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. * - * @param {string} linkId The ID of the replication link to be failed over. + * @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. * @@ -6243,15 +9113,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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * 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 @@ -6259,10 +9128,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. * - * @param {string} linkId The ID of the replication link to be failed over. + * @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. * @@ -6276,7 +9149,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6284,20 +9157,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. + * {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. */ - 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; + 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 { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * 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 @@ -6305,11 +9188,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 @@ -6317,15 +9195,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>; + 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. This operation might result in data loss. + * 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 @@ -6333,11 +9210,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 @@ -6350,7 +9222,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6358,29 +9230,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. + * {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. */ - 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 { + 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 Server Active Directory Administrator or updates 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 @@ -6388,16 +9252,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 @@ -6405,15 +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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(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 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 @@ -6421,16 +9274,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 @@ -6443,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. * @@ -6451,21 +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. */ - 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, 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 an existing server Active Directory Administrator. + * 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 @@ -6473,6 +9315,18 @@ export interface ServerAzureADAdministrators { * * @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} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6480,14 +9334,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, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * 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 @@ -6495,6 +9349,18 @@ export interface ServerAzureADAdministrators { * * @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} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6507,7 +9373,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. * @@ -6515,21 +9381,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. */ - 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, 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 an server Administrator. + * 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 @@ -6537,6 +9402,18 @@ export interface ServerAzureADAdministrators { * * @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} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6544,14 +9421,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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an server Administrator. + * 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 @@ -6559,6 +9436,18 @@ export interface ServerAzureADAdministrators { * * @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} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6571,7 +9460,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. * @@ -6579,27 +9468,23 @@ 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. */ - 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, 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; /** - * 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 - * Manager API or the portal. + * Gets a list of server encryption protectors * - * @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. * @@ -6608,20 +9493,17 @@ 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>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. + * Gets a list of server encryption protectors * - * @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. * @@ -6635,7 +9517,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAdministratorListResult} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6643,38 +9525,39 @@ 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 + * {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. */ - 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 + * FailoverGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FailoverGroups { /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * 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 {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 {string} serverName The name of the server containing the failover + * group. * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -6683,31 +9566,23 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * 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 {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 {string} serverName The name of the server containing the failover + * group. * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -6721,7 +9596,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6729,27 +9604,60 @@ 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. + * {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, 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; + 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; /** - * Deletes an existing server Active Directory Administrator. + * 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. * @@ -6758,20 +9666,54 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * 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. * @@ -6785,7 +9727,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6793,39 +9735,29 @@ 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. + * {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. */ - 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 { + 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; /** - * Deletes a server communication link. + * 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} communicationLinkName The name of the server communication - * link. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -6838,19 +9770,19 @@ export interface ServerCommunicationLinks { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server communication link. + * 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} communicationLinkName The name of the server communication - * link. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -6878,47 +9810,103 @@ export interface ServerCommunicationLinks { * * {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; + 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 a server communication link. + * 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 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. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @returns {Promise} A promise is returned + * + * @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>; + + /** + * 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.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' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns a server communication link. + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. * - * @param {string} resourceGroupName The name 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.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} communicationLinkName The name of the server communication - * link. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6932,7 +9920,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. * @@ -6940,35 +9928,27 @@ 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. */ - 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; + 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; /** - * Creates a server communication link. + * Lists the failover groups 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} 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 {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -6977,28 +9957,21 @@ 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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. + * Lists the failover groups 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} 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 {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7012,7 +9985,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7020,27 +9993,30 @@ 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 + * {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. */ - 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; + 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 server communication links. + * 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 {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 +10025,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>; + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server communication links. + * 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 {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 +10055,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 +10063,30 @@ 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; + 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; /** - * Creates a server communication link. + * 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 {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7121,28 +10095,24 @@ 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>; + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. + * 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 {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7156,7 +10126,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 +10134,60 @@ 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 { + 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 database service objective. + * 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} serviceObjectiveName The name of the service objective to - * retrieve. + * @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. * @@ -7205,23 +10196,54 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database service objective. + * 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} serviceObjectiveName The name of the service objective to - * retrieve. + * @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. * @@ -7235,7 +10257,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjective} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7243,26 +10265,29 @@ 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. + * {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, 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; + 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; /** - * Returns database service objectives. + * 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} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7271,20 +10296,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database service objectives. + * 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} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7298,7 +10326,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjectiveListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7306,108 +10334,109 @@ 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. + * {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 - * Servers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Servers { + 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; /** - * Determines whether a resource can be created with the specified name. + * Updates a failover group. * - * @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. + * @param {string} failoverGroupName The name of the failover group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters The failover group parameters. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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' * - * @reject {Error|ServiceError} - The error object. - */ - checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Determines whether a resource can be created with the specified name. + * @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 The parameters to request for name availability. + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. * - * @param {string} parameters.name The name whose availability is to be - * checked. + * @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. * * @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. + * @returns {Promise} A promise is returned * - * {Promise} A promise is returned. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @resolve {CheckNameAvailabilityResponse} - 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>; + + /** + * Updates a failover group. * - * @reject {Error|ServiceError} - The error object. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} serverName The name of the server containing the failover + * group. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} failoverGroupName The name of the failover group. * - * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. - * See {@link CheckNameAvailabilityResponse} for more - * information. + * @param {object} parameters The failover group parameters. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. * - * {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; - - - /** - * Gets a list of all servers in the subscription. + * @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 {object} [options] Optional Parameters. + * @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} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [parameters.databases] List of databases in the failover + * group. * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of all servers in the subscription. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7421,7 +10450,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 +10458,30 @@ 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; + 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; /** - * Gets a list of servers in a resource groups. + * 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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7455,19 +10489,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. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(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. * * @param {string} resourceGroupName The name of the resource group that * contains 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 +10519,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 +10527,30 @@ 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; + 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; /** - * Gets 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 {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. * @@ -7516,20 +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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets 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 {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. * @@ -7541,58 +10588,33 @@ export interface Servers { * @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 {Server} - 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. - * - * {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, 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; - - - /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * {Promise} A promise is returned. * - * @param {object} parameters The requested server resource state. + * @resolve {FailoverGroup} - The deserialized result object. * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. + * @reject {Error|ServiceError} - The error object. * - * @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' + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * - * @param {string} [parameters.version] The version of the server. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.tags] Resource tags. + * {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; + + + /** + * Lists the failover groups in a server. * - * @param {string} parameters.location Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7601,42 +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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * 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. + * Lists the failover groups in a server. * - * @param {string} parameters.location Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7650,7 +10647,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7658,26 +10655,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. + * {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. */ - 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; + 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 { /** - * 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. - * - * @param {string} serverName The name of the server. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -7686,20 +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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(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. - * - * @param {string} serverName The name of the server. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -7713,7 +10708,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7721,37 +10716,23 @@ 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. + * {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. */ - 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; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * 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. + * Lists all of the available SQL Rest API operations. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7760,32 +10741,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. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, 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. + * Lists all of the available SQL Rest API operations. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7799,7 +10765,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. * @@ -7807,20 +10773,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. + * {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. */ - 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; + 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 { /** - * Creates or updates a server. + * 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 @@ -7828,28 +10803,6 @@ export interface Servers { * * @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} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7857,14 +10810,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server. + * 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 @@ -7872,28 +10825,6 @@ export interface Servers { * * @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} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7906,7 +10837,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7914,20 +10845,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. + * {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. */ - 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; + 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 a server. + * 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 @@ -7935,6 +10866,8 @@ export interface Servers { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be retrieved. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7942,14 +10875,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server. + * 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 @@ -7957,6 +10890,8 @@ export interface Servers { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be retrieved. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7969,7 +10904,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7977,19 +10912,20 @@ 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. + * {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. */ - 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; + 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; /** - * Updates a server. + * 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 @@ -7997,17 +10933,27 @@ export interface Servers { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested server resource state. + * @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} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters The requested server key resource state. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * @param {string} [parameters.version] The version of the server. + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -8016,14 +10962,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server. + * 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 @@ -8031,17 +10977,27 @@ export interface Servers { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested server resource state. + * @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} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters The requested server key resource state. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * @param {string} [parameters.version] The version of the server. + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -8055,7 +11011,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8063,23 +11019,28 @@ 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. + * {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. */ - 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; + 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 list of all servers in the subscription. + * Deletes the server key with the given name. * - * @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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8088,17 +11049,22 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all servers in the subscription. + * Deletes the server key with the given name. * - * @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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8112,7 +11078,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8120,23 +11086,47 @@ 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. + * {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. */ - 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; + 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; /** - * Gets a list of servers in a resource groups. + * Creates or updates a server key. * - * @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} 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. * @@ -8145,17 +11135,42 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of servers in a resource groups. + * Creates or updates a server key. * - * @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} 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. * @@ -8169,7 +11184,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8177,29 +11192,20 @@ 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. + * {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. */ - 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 { + 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 elastic pool activities. + * 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 @@ -8207,8 +11213,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 deleted. * * @param {object} [options] Optional Parameters. * @@ -8217,14 +11222,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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool activities. + * 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 @@ -8232,8 +11237,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 deleted. * * @param {object} [options] Optional Parameters. * @@ -8247,7 +11251,7 @@ export interface ElasticPoolActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolActivityListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8255,38 +11259,22 @@ 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. + * {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; -} - -/** - * @class - * ElasticPoolDatabaseActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolDatabaseActivities { - - - /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + 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} elasticPoolName The name of the elastic pool. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8295,22 +11283,17 @@ 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>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a list of server keys. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8324,7 +11307,7 @@ export interface ElasticPoolDatabaseActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8332,39 +11315,38 @@ 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. + * {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. */ - 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; + 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 - * RecommendedElasticPools + * SyncAgents * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface RecommendedElasticPools { +export interface SyncAgents { /** - * Gets a recommented elastic pool. + * 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} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8373,23 +11355,23 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recommented elastic pool. + * 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} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8403,7 +11385,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPool} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8411,27 +11393,34 @@ 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. + * {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, 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; + 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; /** - * Returns recommended elastic pools. + * 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} 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. * @@ -8440,20 +11429,28 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommended elastic pools. + * 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} 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. * @@ -8467,7 +11464,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8475,30 +11472,29 @@ 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. + * {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. */ - 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, 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; /** - * Returns recommented elastic pool metrics. + * 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} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8507,23 +11503,23 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommented elastic pool metrics. + * 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} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8537,7 +11533,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 +11541,26 @@ 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 { + 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; /** - * Gets a service tier advisor. + * 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 database. - * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8587,24 +11569,21 @@ 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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a service tier advisor. + * 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 database. - * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8618,7 +11597,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisor} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8626,28 +11605,29 @@ 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. + * {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. */ - 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; + 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 service tier advisors for specified database. + * 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} databaseName The name of database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8656,22 +11636,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>; + generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns service tier advisors for specified database. + * 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} databaseName The name of database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8685,7 +11666,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. + * @resolve {SyncAgentKeyProperties} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8693,45 +11674,30 @@ 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 + * {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. */ - 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 { + 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; /** - * Creates or updates a database's transparent data encryption configuration. + * 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} databaseName The name of the database for which setting the - * transparent data encryption applies. - * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8740,29 +11706,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's transparent data encryption configuration. + * 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} databaseName The name of the database for which setting the - * transparent data encryption applies. - * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8776,7 +11736,7 @@ export interface TransparentDataEncryptions { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryption} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8784,30 +11744,35 @@ 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 + * {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. */ - 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; + 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 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 the - * transparent data encryption applies. + * @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. * @@ -8816,23 +11781,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. */ - 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 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 the - * transparent data encryption applies. + * @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. * @@ -8846,7 +11816,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. * @@ -8854,39 +11824,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. */ - 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 { + 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; /** - * Returns a database's transparent data encryption operation result. + * 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. * @@ -8895,23 +11855,23 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a database's transparent data encryption operation result. + * 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. * @@ -8925,7 +11885,7 @@ export interface TransparentDataEncryptionActivities { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8933,36 +11893,22 @@ 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. + * {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. */ - 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 { + 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; /** - * 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 - * 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. * @@ -8971,20 +11917,17 @@ 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>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * 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. * @@ -8998,7 +11941,7 @@ export interface ServerUsages { * * {Promise} A promise is returned. * - * @resolve {ServerUsageListResult} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9006,37 +11949,23 @@ 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. + * {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; -} - -/** - * @class - * DatabaseUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseUsages { + 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; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Lists databases linked to a sync agent. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9045,22 +11974,17 @@ 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>; + listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Lists databases linked to a sync agent. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9074,7 +11998,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 +12006,33 @@ 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; + 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 - * DatabaseBlobAuditingPolicies + * SyncGroups * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseBlobAuditingPolicies { +export interface SyncGroups { /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a collection of sync database ids. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9123,23 +12041,17 @@ 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>; + listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a collection of sync database ids. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9153,7 +12065,7 @@ export interface DatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9161,56 +12073,32 @@ 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 + * {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. - */ - 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 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 - * 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. + * {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; + + + /** + * Refreshes a hub database schema. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit 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 {array} [parameters.auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. + * @param {string} serverName The name of the server. * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9219,14 +12107,14 @@ 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>; + refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's blob auditing policy. + * 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 @@ -9234,34 +12122,10 @@ export interface DatabaseBlobAuditingPolicies { * * @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} databaseName The name of the database on which the sync + * group is hosted. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9275,7 +12139,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,30 +12147,19 @@ 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 { + 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} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -9314,6 +12167,11 @@ export interface EncryptionProtectors { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9321,14 +12179,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: 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} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -9336,6 +12194,11 @@ export interface EncryptionProtectors { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9348,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. * @@ -9356,21 +12219,21 @@ 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. */ - 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; + 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 server encryption protector. + * 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 @@ -9378,21 +12241,36 @@ export interface EncryptionProtectors { * * @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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: 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 server encryption protector. + * 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 @@ -9400,8 +12278,23 @@ export interface EncryptionProtectors { * * @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 * @@ -9412,7 +12305,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9420,20 +12313,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. + * {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, 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; + 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; /** - * Updates an existing encryption protector. + * 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 @@ -9441,17 +12335,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. * @@ -9460,14 +12347,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. + * 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 @@ -9475,17 +12362,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. * @@ -9499,7 +12379,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. * @@ -9507,20 +12387,19 @@ 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. */ - 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; + 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; /** - * Updates an existing encryption protector. + * 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 @@ -9528,17 +12407,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 +12419,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>; + triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. + * 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 @@ -9562,17 +12434,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 +12451,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 +12459,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; + 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; /** - * Gets a list of server encryption protectors + * Gets a sync group. * - * @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 +12491,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server encryption protectors + * Gets a sync group. * - * @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 +12523,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtectorListResult} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9651,39 +12531,55 @@ 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. + * {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. */ - 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 { + 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; /** - * Gets 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 {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. * @@ -9692,23 +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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: 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>; /** - * Gets 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 {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. * @@ -9722,7 +12644,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. * @@ -9730,60 +12652,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. */ - 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; + 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; /** - * Creates or updates a failover group. + * 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} 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 +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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * 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} 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 +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. * @@ -9861,29 +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. */ - 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; + 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; /** - * Deletes a failover group. + * 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} resourceGroupName The name 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.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} failoverGroupName The name of the failover 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. * @@ -9892,23 +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. */ - deleteMethodWithHttpOperationResponse(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>; /** - * Deletes a failover group. + * 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. * @@ -9922,7 +12837,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9930,56 +12845,29 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; /** - * 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.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 {string} serverName The name of the server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -9988,51 +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. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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.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 {string} serverName The name of the server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -10046,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. * @@ -10054,27 +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. */ - 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; + 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; /** - * Lists the failover groups in a server. + * 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} 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. * @@ -10083,21 +12947,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * 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} 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. * @@ -10111,7 +12979,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10119,30 +12987,54 @@ 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. + * {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; + 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; /** - * Fails over from the current primary server to this 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} 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. * @@ -10151,23 +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. */ - failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(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. + * 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} failoverGroupName The name of the failover group. + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10181,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. * @@ -10189,30 +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. */ - 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; + 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. This operation - * might result in data loss. + * 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. * @@ -10221,24 +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. */ - forceFailoverAllowDataLossWithHttpOperationResponse(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. This operation - * might result in data loss. + * 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. * @@ -10252,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. * @@ -10260,60 +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. */ - 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; + 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; /** - * Creates or updates a failover group. + * 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.tags] Resource tags. + * @param {object} parameters The requested sync group resource state. * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. + * @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.partnerServers List of partner server information - * for the failover group. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {array} [parameters.databases] List of databases in the failover - * 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. * @@ -10322,54 +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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * 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.tags] Resource tags. + * @param {object} parameters The requested sync group resource state. * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. + * @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.partnerServers List of partner server information - * for the failover group. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {array} [parameters.databases] List of databases in the failover - * 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. * @@ -10383,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. * @@ -10391,29 +13300,23 @@ 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. */ - 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; + 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; /** - * 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 containing the failover - * group. + * Gets a collection of sync database ids. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10422,23 +13325,17 @@ 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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 containing the failover - * group. + * Gets a collection of sync database ids. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10452,7 +13349,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10460,56 +13357,82 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; /** - * Updates a failover group. + * Gets a collection of hub database schemas. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {object} [options] Optional Parameters. * - * @param {string} failoverGroupName The name of the failover group. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters The failover group parameters. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @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' + * @reject {Error|ServiceError} - The error object. + */ + listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of hub database schemas. * - * @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} 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 {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 {SyncFullSchemaPropertiesListResult} - 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 {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * {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; + + + /** + * Gets a collection of sync group logs. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10518,51 +13441,17 @@ 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>; + listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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.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. + * Gets a collection of sync group logs. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10576,7 +13465,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. * @@ -10584,29 +13473,24 @@ 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. */ - 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; + 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; /** - * 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. + * Lists sync groups under a hub database. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10615,23 +13499,17 @@ 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>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Lists sync groups under a hub database. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10645,7 +13523,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. * @@ -10653,30 +13531,43 @@ 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. */ - 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; + 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 { /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * 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 * 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 on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -10685,24 +13576,28 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * 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 * 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 on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -10716,7 +13611,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10724,23 +13619,61 @@ 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. + * {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. */ - 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; + 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; /** - * Lists the failover groups in a server. + * Creates or updates a sync member. * - * @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} 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. * @@ -10749,17 +13682,55 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * 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} [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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -10773,7 +13744,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10781,30 +13752,34 @@ 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. + * {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. */ - 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 { + 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; /** - * Lists all of the available SQL Rest API operations. + * 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. + * + * @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. * @@ -10813,14 +13788,28 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * 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. + * + * @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. * @@ -10834,7 +13823,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10842,23 +13831,60 @@ 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. + * {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. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(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; /** - * Lists all of the available SQL Rest API operations. + * Updates an existing sync member. * - * @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} 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. * @@ -10867,17 +13893,55 @@ 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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Updates an existing sync member. * - * @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} 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. * @@ -10891,7 +13955,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10899,29 +13963,20 @@ 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. + * {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. */ - 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 { + 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; /** - * Gets a list of server keys. + * 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 @@ -10929,6 +13984,11 @@ export interface ServerKeys { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -10936,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. + * 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 @@ -10951,6 +14011,11 @@ export interface ServerKeys { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -10963,7 +14028,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10971,20 +14036,20 @@ 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. + * {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. */ - 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; + 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 server key. + * Gets 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 @@ -10992,7 +14057,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 +14072,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>; + listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server key. + * Gets 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 @@ -11016,7 +14087,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 +14107,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11038,20 +14115,21 @@ 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. + * {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. */ - 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; + 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; /** - * Creates or updates a server 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 @@ -11059,27 +14137,13 @@ 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 {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} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11088,14 +14152,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>; + refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server 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 @@ -11103,27 +14167,13 @@ 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 {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} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11137,7 +14187,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11145,20 +14195,19 @@ 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. + * {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, 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; + 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; /** - * Deletes the server key with the given name. + * 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 @@ -11166,7 +14215,40 @@ 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} 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. * @@ -11175,14 +14257,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, 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>; /** - * Deletes the server key with the given name. + * 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 @@ -11190,7 +14272,40 @@ 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} 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. * @@ -11204,7 +14319,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11212,19 +14327,20 @@ 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. + * {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. */ - 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; + 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; /** - * Creates or updates a server key. + * 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 @@ -11232,27 +14348,13 @@ 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 {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} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11261,14 +14363,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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * 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 @@ -11276,27 +14378,13 @@ 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 {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} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11310,7 +14398,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11318,28 +14406,60 @@ 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. + * {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, 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; + 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; /** - * Deletes the server key with the given name. + * 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. + * + * @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} resourceGroupName The name 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.databaseName] Database name of the member + * database in the sync member. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.userName] User name of the member database in + * the sync member. * - * @param {string} keyName The name of the server key to be deleted. + * @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. * @@ -11348,14 +14468,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>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * 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 @@ -11363,63 +14483,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key 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) + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} syncMemberName The name of the sync member. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} parameters The requested sync member resource state. * - * {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; - - - /** - * Gets a list of server keys. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {object} [options] Optional Parameters. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member * - * @returns {Promise} A promise is returned + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.userName] User name of the member database in + * the sync member. * - * @reject {Error|ServiceError} - The error object. - */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of server keys. + * @param {string} [parameters.password] Password of the member database in the + * sync member. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11433,7 +14530,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11441,38 +14538,34 @@ 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. + * {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. */ - 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 { + 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; /** - * 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 +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. */ - getWithHttpOperationResponse(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>; /** - * 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 +14609,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 +14617,22 @@ 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; + 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; /** - * 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. + * Lists sync members in the given sync group. * - * @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. * @@ -11555,28 +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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupNextWithHttpOperationResponse(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. + * Lists sync members in the given sync group. * - * @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. * @@ -11590,7 +14665,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11598,29 +14673,23 @@ 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. + * {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. */ - 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; + 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; /** - * 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 a sync member database schema. * - * @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. * @@ -11629,23 +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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMemberSchemasNextWithHttpOperationResponse(nextPageLink: 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 a sync member database schema. * - * @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. * @@ -11659,7 +14722,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11667,26 +14730,33 @@ 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. + * {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. */ - 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; + 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 { /** - * 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. + * Gets all subscription usage metrics in a given location. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -11695,21 +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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets all subscription usage metrics in a given location. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -11723,7 +14789,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11731,29 +14797,26 @@ 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. + * {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. */ - 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; + 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; /** - * 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. + * Gets a subscription usage metric. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -11762,23 +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. */ - generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a subscription usage metric. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -11792,7 +14851,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentKeyProperties} - The deserialized result object. + * @resolve {SubscriptionUsage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11800,30 +14859,23 @@ 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. + * {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. */ - 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; + 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. - * - * @param {string} resourceGroupName The name of the resource group that - * contains 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} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11832,23 +14884,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>; + listByLocationNextWithHttpOperationResponse(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. + * Gets all subscription usage metrics in a given location. * - * @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 +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. * @@ -11870,35 +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. */ - 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; + 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 + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface VirtualNetworkRules { /** - * Creates or updates a sync agent. + * Gets a 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 * 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. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -11907,28 +14956,22 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Gets a 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 * 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. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -11942,7 +14985,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11950,29 +14993,37 @@ 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. + * {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. */ - 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; + 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; /** - * Deletes a sync agent. + * 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 * 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} 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 {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -11981,23 +15032,31 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * 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 * 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} 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 {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12011,7 +15070,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12019,22 +15078,28 @@ 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. + * {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. */ - 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; + 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; /** - * Lists sync agents in a server. + * Deletes the virtual network rule with the given name. * - * @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} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12043,17 +15108,22 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Deletes the virtual network rule with the given name. * - * @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} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12067,7 +15137,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12075,23 +15145,25 @@ 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. + * {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. */ - 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; + 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; /** - * Lists databases linked to a sync agent. + * Gets a list of virtual network rules in a server. * - * @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. * @@ -12100,17 +15172,20 @@ 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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Gets a list of virtual network rules in a server. * - * @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. * @@ -12124,7 +15199,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12132,33 +15207,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 + * {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. - */ - 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 { + * {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; /** - * Gets a collection of sync database ids. + * Creates or updates an existing 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} 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. * @@ -12167,17 +15247,31 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Creates or updates an existing 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} 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. * @@ -12191,7 +15285,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 +15293,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; + 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; /** - * Refreshes a hub database schema. + * 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 @@ -12221,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. * @@ -12237,10 +15327,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - refreshHubSchemaWithHttpOperationResponse(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>; /** - * Refreshes a hub database schema. + * 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 @@ -12248,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. * @@ -12279,24 +15366,16 @@ export interface SyncGroups { * * {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; + 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 collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. * @@ -12305,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. */ - listHubSchemasWithHttpOperationResponse(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 collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. * @@ -12337,7 +15408,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12345,82 +15416,65 @@ 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 + * {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. */ - 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; + 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 { /** - * 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. + * Gets a long term retention backup. * - * @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} locationName The location of the database. * - * @param {string} startTime Get logs generated after this time. + * @param {string} longTermRetentionServerName * - * @param {string} endTime Get logs generated before this time. + * @param {string} longTermRetentionDatabaseName * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} backupName The backup name. * * @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>; + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a long term retention backup. * - * @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} locationName The location of the database. * - * @param {string} startTime Get logs generated after this time. + * @param {string} longTermRetentionServerName * - * @param {string} endTime Get logs generated before this time. + * @param {string} longTermRetentionDatabaseName * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} backupName The backup name. * * @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 +15485,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12439,32 +15493,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 + * {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. */ - 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; + 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; /** - * Cancels a sync group synchronization. + * 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. * @@ -12477,21 +15528,18 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - cancelSyncWithHttpOperationResponse(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>; /** - * Cancels a sync group synchronization. + * 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. * @@ -12519,54 +15567,58 @@ export interface SyncGroups { * * {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; + 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; /** - * 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. + * Lists all long term retention backups for a database. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionServerName * - * @param {string} syncGroupName The name of the sync group. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Lists all long term retention backups for a database. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionServerName * - * @param {string} syncGroupName The name of the sync group. + * @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 * @@ -12577,7 +15629,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. * @@ -12585,60 +15637,58 @@ 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. */ - 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; + 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; /** - * Gets a sync group. + * 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} serverName The name of the server. + * @param {string} locationName The location of the database * - * @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. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the long term retention backups for a given location. * - * @param {string} syncGroupName The name of the sync group. + * @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 * @@ -12649,7 +15699,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. * @@ -12657,108 +15707,61 @@ 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. */ - 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; + 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; /** - * 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. + * Lists the long term retention backups for a given server. * - * @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 {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 {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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, 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. + * Lists the long term retention backups for a given server. * - * @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} locationName The location of the database * - * @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 {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 @@ -12770,7 +15773,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. * @@ -12778,31 +15781,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. + * {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. */ - 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; + 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; /** - * 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 +15816,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>; + beginDeleteMethodWithHttpOperationResponse(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,99 +15855,93 @@ 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; + 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; /** - * 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} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @returns {Promise} A promise is returned * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all long term retention backups for a database. * - * @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. * * @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. - */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a sync group. + * {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 {LongTermRetentionBackupListResult} - 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 on which the sync - * group is hosted. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} syncGroupName The name of the sync group. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {object} parameters The requested sync group resource state. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * {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; + + + /** + * Lists the long term retention backups for a given location. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @reject {Error|ServiceError} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. * @@ -12963,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. * @@ -12971,29 +15963,24 @@ 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; + 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; /** - * 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. + * Lists the long term retention backups for a given server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13002,23 +15989,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. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * 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} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13032,7 +16013,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,20 +16021,30 @@ 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; + 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 { /** - * Refreshes a hub database schema. + * 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 @@ -13061,10 +16052,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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13073,14 +16061,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. */ - beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * 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 @@ -13088,10 +16076,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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13105,7 +16090,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13113,19 +16098,21 @@ 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. + * {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. */ - 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; + 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 sync group. + * 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 @@ -13133,34 +16120,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 {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} databaseName The name of the database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} parameters The long term retention policy info. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13169,14 +16143,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. + * 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 @@ -13184,34 +16158,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 {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} databaseName The name of the database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} parameters The long term retention policy info. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13225,7 +16186,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13233,20 +16194,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. + * {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. */ - 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; + 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; /** - * Deletes a sync group. + * 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 @@ -13254,10 +16216,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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13266,14 +16225,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * 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 @@ -13281,10 +16240,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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13298,7 +16254,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13306,19 +16262,21 @@ 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. + * {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. */ - 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; + 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; /** - * Updates a sync group. + * 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 @@ -13326,34 +16284,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 {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} databaseName The name of the database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} parameters The long term retention policy info. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13362,14 +16307,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. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. + * 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 @@ -13377,34 +16322,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 {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} databaseName The name of the database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {object} parameters The long term retention policy info. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13418,7 +16350,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13426,81 +16358,36 @@ 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. + * {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. */ - 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; + 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 { - /** - * Gets a collection of sync database ids. - * - * @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|ServiceError} - The error object. - */ - listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. - * - * @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 {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 {SyncDatabaseIdListResult} - 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. - * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more - * information. + * Retrieves server automatic tuning options. * - * {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; - - - /** - * Gets a collection of hub database schemas. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -13509,17 +16396,20 @@ 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Retrieves server automatic tuning options. * - * @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. * @@ -13533,7 +16423,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13541,24 +16431,33 @@ 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. + * {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. */ - 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, 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 collection of sync group logs. + * Update automatic tuning options on server. * - * @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} 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. * @@ -13567,17 +16466,27 @@ 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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Update automatic tuning options on server. * - * @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} 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. * @@ -13591,7 +16500,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13599,24 +16508,38 @@ 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 - * 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. */ - 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; + 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 { /** - * Lists sync groups under a hub database. + * Gets a server DNS alias. * - * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -13625,17 +16548,23 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Gets a server DNS alias. * - * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -13649,7 +16578,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13657,43 +16586,29 @@ 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. + * {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. */ - 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 { + 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; /** - * Gets 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. * @@ -13702,28 +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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets 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. * @@ -13737,7 +16647,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. * @@ -13745,61 +16655,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. */ - 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; + 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; /** - * Creates or updates a 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. * @@ -13808,55 +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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a 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} serverName The name of the server that the alias is pointing + * to. * - * @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 {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -13870,7 +16716,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. * @@ -13878,34 +16724,26 @@ 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. */ - 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; + 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; /** - * Deletes a sync member. + * 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. * @@ -13914,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. */ - deleteMethodWithHttpOperationResponse(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>; /** - * Deletes a sync member. + * 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. * @@ -13949,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. * @@ -13957,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. */ - 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; + 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 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} [parameters.userName] User 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.password] Password of the member database in the - * sync member. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @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. * @@ -14019,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. */ - updateWithHttpOperationResponse(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>; /** - * Updates an existing 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. * @@ -14081,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. * @@ -14089,31 +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. */ - 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; + 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; /** - * 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 +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. */ - listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(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 +16928,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 +16936,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; + 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; /** - * 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} serverName The name of the server that the alias is pointing + * to. * - * @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} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14198,28 +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. */ - listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(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 +16997,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 +17005,33 @@ 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; + 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. * @@ -14282,24 +17044,24 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - refreshMemberSchemaWithHttpOperationResponse(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. * @@ -14327,54 +17089,88 @@ export interface SyncMembers { * * {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; + 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; /** - * Creates or updates a sync member. + * 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} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @returns {Promise} A promise is returned * - * @param {string} syncMemberName The name of the sync member. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} parameters The requested sync member resource state. + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of server DNS aliases for a server. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {object} [options] Optional Parameters. * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * {Promise} A promise is returned. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {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. + */ + 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 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. * @@ -14383,14 +17179,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * 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 @@ -14398,40 +17194,87 @@ 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} [options] Optional Parameters. * - * @param {string} syncMemberName The name of the sync member. + * @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 {RestorePointListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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} parameters The requested sync member resource state. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @reject {Error|ServiceError} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a restore point for a data warehouse. * - * @param {string} [parameters.serverName] Server name of the member database - * in the 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} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {object} parameters The definition for creating the restore point of + * this database. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14445,7 +17288,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14453,20 +17296,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. + * {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. */ - 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; + 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; /** - * Deletes a sync member. + * 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 @@ -14474,13 +17317,9 @@ 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} databaseName The name of the database. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14489,14 +17328,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * 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 @@ -14504,13 +17343,9 @@ 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} databaseName The name of the database. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14524,7 +17359,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14532,19 +17367,20 @@ 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. + * {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. */ - 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; + 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; /** - * Updates an existing sync member. + * 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 @@ -14552,40 +17388,9 @@ 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} databaseName The name of the database. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14594,14 +17399,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. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * 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 @@ -14609,40 +17414,9 @@ 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} databaseName The name of the database. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14656,7 +17430,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,20 +17438,19 @@ 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; + 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; /** - * Refreshes a sync member database schema. + * 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 @@ -14685,13 +17458,13 @@ 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 definition for creating the restore point of + * this database. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14700,14 +17473,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. */ - beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * 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 @@ -14715,13 +17488,13 @@ 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 definition for creating the restore point of + * this database. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14735,7 +17508,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14743,22 +17516,39 @@ 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. + * {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. */ - 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; + 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 { /** - * Lists sync members in the given sync group. + * Cancels the asynchronous operation on the database. * - * @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 {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -14767,17 +17557,24 @@ 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>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Cancels the asynchronous operation on the database. * - * @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 {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -14791,7 +17588,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14799,23 +17596,27 @@ 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. + * {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. */ - 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; + 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; /** - * Gets a sync member database schema. + * Gets a list of operations performed on the database. * - * @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 +17625,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 operations performed on the database. * - * @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 +17654,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14856,38 +17662,24 @@ 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 + * {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. - */ - 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. - * - * @param {string} resourceGroupName The name of the resource group that - * contains 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 a list of operations performed on the database. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14896,22 +17688,17 @@ 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>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a list of operations performed on the database. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14925,7 +17712,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14933,20 +17720,30 @@ 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. + * {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. */ - 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; + 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 + * ElasticPoolOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolOperations { /** - * Creates or updates an existing virtual network rule. + * 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 @@ -14954,16 +17751,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} elasticPoolName * - * @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. * @@ -14972,14 +17762,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>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * 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 @@ -14987,16 +17777,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} elasticPoolName * - * @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. * @@ -15010,7 +17793,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. * @@ -15018,20 +17801,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. */ - 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; + 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; /** - * Deletes the virtual network rule with the given name. + * 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 @@ -15039,7 +17821,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15048,14 +17830,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * 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 @@ -15063,7 +17845,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15077,7 +17859,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15085,25 +17867,24 @@ 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. + * {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. */ - 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; + 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 virtual network rules in a server. + * 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} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15112,20 +17893,17 @@ 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>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. + * Gets a list of operations performed on the elastic pool. * - * @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. * @@ -15139,7 +17917,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15147,21 +17925,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 + * {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. */ - 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; + 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 + * DatabaseVulnerabilityAssessmentScans + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseVulnerabilityAssessmentScans { /** - * Creates or updates an existing virtual network rule. + * Gets a vulnerability assessment scan record of a 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 +17956,10 @@ 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -15187,14 +17968,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Gets a vulnerability assessment scan record of a 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 +17983,10 @@ 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -15225,7 +18000,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {VulnerabilityAssessmentScanRecord} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15233,20 +18008,21 @@ 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. + * {VulnerabilityAssessmentScanRecord} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecord} 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, 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; + get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Executes a Vulnerability Assessment database scan. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15254,7 +18030,10 @@ 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -15267,10 +18046,10 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + executeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Executes a Vulnerability Assessment database scan. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15278,7 +18057,10 @@ 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} scanId The vulnerability assessment scan Id of the scan to + * retrieve. * * @param {object} [options] Optional Parameters. * @@ -15306,16 +18088,21 @@ export interface VirtualNetworkRules { * * {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; + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Lists the vulnerability assessment scans of a database. * - * @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. * @@ -15324,17 +18111,22 @@ 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>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Lists the vulnerability assessment scans of a database. * - * @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. * @@ -15348,7 +18140,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {VulnerabilityAssessmentScanRecordListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15356,30 +18148,22 @@ 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. + * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecordListResult} + * 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 - * DatabaseOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseOperations { + 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; /** - * Cancels the asynchronous operation on the database. + * Convert an existing scan result to a human readable format. If already + * exists nothing happens * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15387,9 +18171,9 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the scanned database. * - * @param {uuid} operationId The operation identifier. + * @param {string} scanId The vulnerability assessment scan Id. * * @param {object} [options] Optional Parameters. * @@ -15398,14 +18182,15 @@ 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. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * Convert an existing scan result to a human readable format. If already + * exists nothing happens * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15413,9 +18198,9 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the scanned database. * - * @param {uuid} operationId The operation identifier. + * @param {string} scanId The vulnerability assessment scan Id. * * @param {object} [options] Optional Parameters. * @@ -15429,7 +18214,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessmentScansExport} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15437,19 +18222,21 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseVulnerabilityAssessmentScansExport} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseVulnerabilityAssessmentScansExport} + * 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. */ - 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; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Executes a Vulnerability Assessment database scan. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15459,6 +18246,9 @@ export interface DatabaseOperations { * * @param {string} databaseName The name of the database. * + * @param {string} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15466,14 +18256,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>; + beginExecuteWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Executes a Vulnerability Assessment database scan. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15483,6 +18273,9 @@ export interface DatabaseOperations { * * @param {string} databaseName The name of the database. * + * @param {string} scanId The vulnerability assessment scan Id of the scan to + * retrieve. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15495,7 +18288,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15503,21 +18296,19 @@ 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 - * 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; + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Lists the vulnerability assessment scans of a database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15529,14 +18320,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>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Lists the vulnerability assessment scans of a database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15553,7 +18344,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {VulnerabilityAssessmentScanRecordListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15561,15 +18352,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 - * information. + * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecordListResult} + * 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; + 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; } diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 604e407dcc..10f0351dcc 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,13 @@ 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'); +exports.DatabaseVulnerabilityAssessmentScans = require('./databaseVulnerabilityAssessmentScans'); 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..3899db5f5b 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,16 @@ 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; + databaseVulnerabilityAssessmentScans: operations.DatabaseVulnerabilityAssessmentScans; } -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..732c918db9 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,16 @@ 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.databaseVulnerabilityAssessmentScans = new operations.DatabaseVulnerabilityAssessmentScans(this); this.models = models; msRest.addSerializationMixin(this); } @@ -115,3 +121,6 @@ class SqlManagementClient extends ServiceClient { } module.exports = SqlManagementClient; +module.exports['default'] = SqlManagementClient; +module.exports.SqlManagementClient = SqlManagementClient; +module.exports.SqlManagementModels = models; From 06aa9735207c2fae19ef4c3418be47ff1efc5d68 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 15 Apr 2018 08:35:59 +0000 Subject: [PATCH 2/4] Generated from db3276b4efb64a992ae6b83d16e79555edc359b3 Add new swagger to more packges Add new swagger to both package-composite-v1 and -v2 sections, and package-pure-2017-10-preview --- lib/services/sqlManagement2/LICENSE.txt | 42 +- lib/services/sqlManagement2/README.md | 80 +- .../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 | 4189 +++++----- .../sqlManagement2/lib/models/index.js | 75 +- .../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 | 4 +- .../lib/operations/capabilities.js | 61 +- .../lib/operations/databases.js | 6439 ++++++++------- .../lib/operations/elasticPools.js | 2258 ++++-- .../sqlManagement2/lib/operations/index.d.ts | 7041 ++++++++--------- .../sqlManagement2/lib/operations/index.js | 9 +- .../lib/sqlManagementClient.d.ts | 9 +- .../sqlManagement2/lib/sqlManagementClient.js | 9 +- lib/services/sqlManagement2/package.json | 33 +- 38 files changed, 12052 insertions(+), 10707 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 diff --git a/lib/services/sqlManagement2/LICENSE.txt b/lib/services/sqlManagement2/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/sqlManagement2/LICENSE.txt +++ b/lib/services/sqlManagement2/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -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 +The MIT License (MIT) + +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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. diff --git a/lib/services/sqlManagement2/README.md b/lib/services/sqlManagement2/README.md index c0d7e0e514..9083240548 100644 --- a/lib/services/sqlManagement2/README.md +++ b/lib/services/sqlManagement2/README.md @@ -1,37 +1,43 @@ -# Microsoft Azure SDK for Node.js - SQLManagement - -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 - -```bash -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}); -}).catch((err) => { - 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 +--- +uid: azure-arm-sql +summary: *content + +--- +# 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 + + +## How to Install + +```bash +npm install azure-arm-sql +``` + +## 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 occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [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 72bbdeabf9..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,684 +162,414 @@ 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; -} - -/** - * @class - * Initializes a new instance of the TransparentDataEncryption class. - * @constructor - * Represents a database transparent data encryption configuration. - * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database transparent data - * encryption. Possible values include: 'Enabled', 'Disabled' + * @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 TransparentDataEncryption extends ProxyResource { +export interface DataMaskingPolicy extends ProxyResource { + dataMaskingState: string; + exemptPrincipals?: string; + readonly applicationPrincipals?: string; + readonly maskingLevel?: string; readonly location?: string; - status?: string; + readonly kind?: string; } /** * @class - * Initializes a new instance of the OperationImpact class. + * Initializes a new instance of the DataMaskingRule class. * @constructor - * The impact of an operation, both in absolute and relative terms. + * Represents a database data masking rule. * - * @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} [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 OperationImpact { - readonly name?: string; - readonly unit?: string; - readonly changeValueAbsolute?: number; - readonly changeValueRelative?: number; +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 RecommendedIndex class. + * Initializes a new instance of the FirewallRule class. * @constructor - * Represents a database recommended index. + * Represents a server firewall rule. * - * @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} [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 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 FirewallRule extends ProxyResource { + readonly kind?: string; + readonly location?: string; + startIpAddress: string; + endIpAddress: string; } /** * @class - * Initializes a new instance of the Database class. + * Initializes a new instance of the GeoBackupPolicy 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. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * A database geo backup policy. * - * 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 {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 Database extends TrackedResource { +export interface GeoBackupPolicy extends ProxyResource { + state: string; + readonly storageType?: string; 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; + readonly location?: string; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the ImportExtensionRequest 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. + * 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. - * - * 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 {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 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 ImportExtensionRequest { + name?: string; + type?: string; + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; } /** * @class - * Initializes a new instance of the TransparentDataEncryptionActivity class. + * Initializes a new instance of the ImportExportResponse class. * @constructor - * Represents a database transparent data encryption Scan. + * Response for Import/Export Get operation. * - * @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} [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 TransparentDataEncryptionActivity extends ProxyResource { - readonly location?: string; +export interface ImportExportResponse extends ProxyResource { + readonly requestType?: string; + readonly requestId?: string; + readonly serverName?: string; + readonly databaseName?: string; readonly status?: string; - readonly percentComplete?: number; + readonly lastModifiedTime?: string; + readonly queuedTime?: string; + readonly blobUri?: string; + readonly errorMessage?: string; } /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the ExportRequest class. * @constructor - * Represents the activity on an elastic pool. + * Export database parameters. * - * @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} 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 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 ExportRequest { + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; } /** * @class - * Initializes a new instance of the ElasticPoolActivity class. + * Initializes a new instance of the ImportRequest class. * @constructor - * Represents the activity on an elastic pool. + * Import database parameters. * - * @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} 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 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 ImportRequest extends ExportRequest { + databaseName: string; + edition: string; + serviceObjectiveName: string; + maxSizeBytes: string; } /** * @class - * Initializes a new instance of the RecommendedElasticPoolMetric class. + * Initializes a new instance of the MetricValue class. * @constructor - * Represents recommended elastic pool metric. + * Represents database metrics. * - * @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 {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 RecommendedElasticPoolMetric { - dateTime?: Date; +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; } @@ -1085,1697 +609,2248 @@ export interface RecommendedElasticPool extends ProxyResource { readonly observationPeriodEnd?: Date; readonly maxObservedDtu?: number; readonly maxObservedStorageMB?: number; - readonly databases?: Database[]; + readonly databases?: TrackedResource[]; readonly metrics?: RecommendedElasticPoolMetric[]; } /** * @class - * Initializes a new instance of the DatabaseSecurityAlertPolicy class. + * Initializes a new instance of the ReplicationLink class. * @constructor - * Contains information about a database Threat Detection policy. + * Represents a database replication link. * - * @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} [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 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 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 DataMaskingPolicy class. + * Initializes a new instance of the ServerAzureADAdministrator class. * @constructor - * Represents a database data masking policy. + * An server Active Directory Administrator. * - * @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} 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 DataMaskingPolicy extends ProxyResource { - dataMaskingState: string; - exemptPrincipals?: string; - readonly applicationPrincipals?: string; - readonly maskingLevel?: string; +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 DataMaskingRule class. + * Initializes a new instance of the ServiceObjective class. * @constructor - * Represents a database data masking rule. + * Represents a database service objective. * - * @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} [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 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 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 ElasticPoolDatabaseActivity class. + * @constructor + * Represents the activity on an elastic pool. + * + * @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 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 OperationImpact class. + * @constructor + * The impact of an operation, both in absolute and relative terms. + * + * @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 OperationImpact { + readonly name?: string; + readonly unit?: string; + readonly changeValueAbsolute?: number; + readonly changeValueRelative?: number; +} + +/** + * @class + * Initializes a new instance of the RecommendedIndex class. + * @constructor + * Represents a database recommended index. + * + * @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 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 TransparentDataEncryption class. + * @constructor + * Represents a database transparent data encryption configuration. + * + * @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; - readonly kind?: string; + status?: string; } /** * @class - * Initializes a new instance of the ElasticPool class. + * Initializes a new instance of the SloUsageMetric class. * @constructor - * Represents a database elastic pool. + * A Slo Usage Metric. * - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * @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 SloUsageMetric { + readonly serviceLevelObjective?: string; + readonly serviceLevelObjectiveId?: string; + readonly inRangeTimeRatio?: number; +} + +/** + * @class + * Initializes a new instance of the ServiceTierAdvisor class. + * @constructor + * Represents a Service Tier Advisor. + * + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (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 {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 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 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 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 ElasticPoolUpdate class. + * Initializes a new instance of the ServerUsage class. * @constructor - * Represents an elastic pool update. + * Represents server metrics. * - * @member {object} [tags] Resource tags. - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * @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). - * @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 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 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 FirewallRule class. + * Initializes a new instance of the DatabaseUsage class. * @constructor - * Represents a server firewall rule. + * The database usages. * - * @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 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 FirewallRule extends ProxyResource { - readonly kind?: string; - readonly location?: string; - startIpAddress: string; - endIpAddress: string; +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 GeoBackupPolicy class. + * Initializes a new instance of the DatabaseBlobAuditingPolicy class. * @constructor - * A database geo backup policy. + * A database blob auditing 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. + * @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 GeoBackupPolicy extends ProxyResource { - state: string; - readonly storageType?: string; +export interface DatabaseBlobAuditingPolicy extends ProxyResource { readonly kind?: string; - readonly location?: string; + state: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + auditActionsAndGroups?: string[]; + storageAccountSubscriptionId?: string; + isStorageSecondaryKeyInUse?: boolean; } /** * @class - * Initializes a new instance of the ImportExtensionRequest class. + * Initializes a new instance of the AutomaticTuningOptions class. * @constructor - * Import database parameters. + * Automatic tuning properties for individual advisors. * - * @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} [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 ImportExtensionRequest { - name?: string; - type?: string; - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface AutomaticTuningOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the ImportExportResponse class. + * Initializes a new instance of the DatabaseAutomaticTuning class. * @constructor - * Response for Import/Export Get operation. + * Database-level Automatic Tuning. * - * @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} [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 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 DatabaseAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningOptions }; } /** * @class - * Initializes a new instance of the ExportRequest class. + * Initializes a new instance of the EncryptionProtector class. * @constructor - * Export database parameters. + * The server encryption protector. * - * @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} [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 ExportRequest { - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface EncryptionProtector extends ProxyResource { + kind?: string; + readonly location?: string; + readonly subregion?: string; + serverKeyName?: string; + serverKeyType: string; + readonly uri?: string; + readonly thumbprint?: string; } /** * @class - * Initializes a new instance of the ImportRequest class. + * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. * @constructor - * Import database parameters. + * Read-write endpoint of the failover group instance. * - * @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} 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 ImportRequest extends ExportRequest { - databaseName: string; - edition: string; - serviceObjectiveName: string; - maxSizeBytes: string; +export interface FailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; } /** * @class - * Initializes a new instance of the MetricValue class. + * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. * @constructor - * Represents database metrics. + * Read-only endpoint of the failover group instance. * - * @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} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' */ -export interface MetricValue { - readonly count?: number; - readonly average?: number; - readonly maximum?: number; - readonly minimum?: number; - readonly timestamp?: Date; - readonly total?: number; +export interface FailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; } /** * @class - * Initializes a new instance of the MetricName class. + * Initializes a new instance of the PartnerInfo class. * @constructor - * A database metric name. + * Partner server information for the failover group. * - * @member {string} [value] The name of the database metric. - * @member {string} [localizedValue] The friendly name of the database metric. + * @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 MetricName { - readonly value?: string; - readonly localizedValue?: string; +export interface PartnerInfo { + id: string; + readonly location?: string; + readonly replicationRole?: string; } /** * @class - * Initializes a new instance of the Metric class. + * Initializes a new instance of the FailoverGroup class. * @constructor - * Database metrics. + * A failover group. * - * @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} [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 Metric { - readonly startTime?: Date; - readonly endTime?: Date; - readonly timeGrain?: string; - readonly unit?: string; - readonly name?: MetricName; - readonly metricValues?: MetricValue[]; +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 MetricAvailability class. + * Initializes a new instance of the FailoverGroupUpdate class. * @constructor - * A metric availability value. + * A failover group update request. * - * @member {string} [retention] The length of retention for the database - * metric. - * @member {string} [timeGrain] The granularity of the database metric. + * @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 MetricAvailability { - readonly retention?: string; - readonly timeGrain?: string; +export interface FailoverGroupUpdate { + readWriteEndpoint?: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + databases?: string[]; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the MetricDefinition class. + * Initializes a new instance of the OperationDisplay class. * @constructor - * A database metric definition. + * Display metadata associated with the operation. * - * @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} [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 MetricDefinition { - readonly name?: MetricName; - readonly primaryAggregationType?: string; - readonly resourceUri?: string; - readonly unit?: string; - readonly metricAvailabilities?: MetricAvailability[]; +export interface OperationDisplay { + readonly provider?: string; + readonly resource?: string; + readonly operation?: string; + readonly description?: string; } /** * @class - * Initializes a new instance of the ReplicationLink class. + * Initializes a new instance of the Operation class. * @constructor - * Represents a database replication link. + * SQL REST API operation definition. * - * @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} [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 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 Operation { + readonly name?: string; + readonly display?: OperationDisplay; + readonly origin?: string; + readonly properties?: { [propertyName: string]: any }; } /** * @class - * Initializes a new instance of the ServerAzureADAdministrator class. + * Initializes a new instance of the ServerKey class. * @constructor - * An server Active Directory Administrator. + * A server key. * - * @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 {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 ServerAzureADAdministrator extends ProxyResource { - login: string; - sid: string; - tenantId: 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 ServerCommunicationLink class. + * Initializes a new instance of the ResourceIdentity class. * @constructor - * Server communication link. + * Azure Active Directory identity configuration for a resource. * - * @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 {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 ServerCommunicationLink extends ProxyResource { - readonly state?: string; - partnerServer: string; - readonly location?: string; - readonly kind?: string; +export interface ResourceIdentity { + readonly principalId?: string; + type?: string; + readonly tenantId?: string; } /** * @class - * Initializes a new instance of the ServiceObjective class. + * Initializes a new instance of the Server class. * @constructor - * Represents a database service objective. + * An Azure SQL Database server. * - * @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 {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 ServiceObjective extends ProxyResource { - readonly serviceObjectiveName?: string; - readonly isDefault?: boolean; - readonly isSystem?: boolean; - readonly description?: string; - readonly enabled?: boolean; +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 ServerUsage class. + * Initializes a new instance of the ServerUpdate class. * @constructor - * Represents server metrics. + * An update request for an Azure SQL Database server. * - * @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). + * @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 ServerUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; +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 DatabaseUsage class. + * Initializes a new instance of the SyncAgent class. * @constructor - * The database usages. + * An Azure SQL Database sync agent. * - * @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 {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 DatabaseUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; +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 DatabaseBlobAuditingPolicy class. + * Initializes a new instance of the SyncAgentKeyProperties class. * @constructor - * A database blob auditing policy. + * Properties of an Azure SQL Database sync agent key. * - * @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 {string} [syncAgentKey] Key of sync agent. */ -export interface DatabaseBlobAuditingPolicy extends ProxyResource { - readonly kind?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; +export interface SyncAgentKeyProperties { + readonly syncAgentKey?: string; } /** * @class - * Initializes a new instance of the AutomaticTuningOptions class. + * Initializes a new instance of the SyncAgentLinkedDatabase class. * @constructor - * Automatic tuning properties for individual advisors. + * An Azure SQL Database sync agent linked database. * - * @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 {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 AutomaticTuningOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: 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 DatabaseAutomaticTuning class. + * Initializes a new instance of the SyncDatabaseIdProperties class. * @constructor - * Database-level Automatic Tuning. + * Properties of the sync database id. * - * @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} [id] ARM resource id of sync database. */ -export interface DatabaseAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningOptions }; +export interface SyncDatabaseIdProperties { + readonly id?: string; } /** * @class - * Initializes a new instance of the EncryptionProtector class. + * Initializes a new instance of the SyncFullSchemaTableColumn class. * @constructor - * The server encryption protector. + * Properties of the column in the table of database full schema. * - * @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} [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 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 SyncFullSchemaTable class. + * @constructor + * Properties of the table in the database full schema. + * + * @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 EncryptionProtector extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyName?: string; - serverKeyType: string; - readonly uri?: string; - readonly thumbprint?: 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 FailoverGroupReadWriteEndpoint class. + * Initializes a new instance of the SyncFullSchemaProperties class. * @constructor - * Read-write endpoint of the failover group instance. + * Properties of the database full schema. * - * @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 {array} [tables] List of tables in the database full schema. + * @member {date} [lastUpdateTime] Last update time of the database schema. */ -export interface FailoverGroupReadWriteEndpoint { - failoverPolicy: string; - failoverWithDataLossGracePeriodMinutes?: number; +export interface SyncFullSchemaProperties { + readonly tables?: SyncFullSchemaTable[]; + readonly lastUpdateTime?: Date; } /** * @class - * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. + * Initializes a new instance of the SyncGroupLogProperties class. * @constructor - * Read-only endpoint of the failover group instance. + * Properties of an Azure SQL Database sync group log. * - * @member {string} [failoverPolicy] Failover policy of the read-only endpoint - * for the failover group. Possible values include: 'Disabled', '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 FailoverGroupReadOnlyEndpoint { - failoverPolicy?: string; +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 PartnerInfo class. + * Initializes a new instance of the SyncGroupSchemaTableColumn class. * @constructor - * Partner server information for the failover group. + * Properties of column in sync group table. * - * @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} [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 PartnerInfo { - id: string; - readonly location?: string; - readonly replicationRole?: string; +export interface SyncGroupSchemaTableColumn { + quotedName?: string; + dataSize?: string; + dataType?: string; } /** * @class - * Initializes a new instance of the FailoverGroup class. + * Initializes a new instance of the SyncGroupSchemaTable class. * @constructor - * A failover group. + * Properties of table in sync group schema. * - * @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 {array} [columns] List of columns in sync group schema. + * @member {string} [quotedName] Quoted name of sync group schema table. */ -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 SyncGroupSchemaTable { + columns?: SyncGroupSchemaTableColumn[]; + quotedName?: string; } /** * @class - * Initializes a new instance of the FailoverGroupUpdate class. + * Initializes a new instance of the SyncGroupSchema class. * @constructor - * A failover group update request. + * Properties of sync group schema. * - * @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 {array} [tables] List of tables in sync group schema. + * @member {string} [masterSyncMemberName] Name of master sync member where the + * schema is from. */ -export interface FailoverGroupUpdate { - readWriteEndpoint?: FailoverGroupReadWriteEndpoint; - readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; - databases?: string[]; - tags?: { [propertyName: string]: string }; +export interface SyncGroupSchema { + tables?: SyncGroupSchemaTable[]; + masterSyncMemberName?: string; } /** * @class - * Initializes a new instance of the OperationDisplay class. + * Initializes a new instance of the SyncGroup class. * @constructor - * Display metadata associated with the operation. + * An Azure SQL Database sync group. * - * @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 {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 OperationDisplay { - readonly provider?: string; - readonly resource?: string; - readonly operation?: string; - readonly description?: 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 Operation class. + * Initializes a new instance of the SyncMember class. * @constructor - * SQL REST API operation definition. + * An Azure SQL Database sync member. * - * @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} [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 Operation { - readonly name?: string; - readonly display?: OperationDisplay; - readonly origin?: string; - readonly properties?: { [propertyName: string]: any }; +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 ServerKey class. + * Initializes a new instance of the SubscriptionUsage class. * @constructor - * A server key. + * 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 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} [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 ServerKey extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyType: string; - uri?: string; - thumbprint?: string; - creationDate?: Date; +export interface SubscriptionUsage extends ProxyResource { + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the ResourceIdentity class. + * Initializes a new instance of the VirtualNetworkRule class. * @constructor - * Azure Active Directory identity configuration for a resource. + * A virtual network rule. * - * @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. + * @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 ResourceIdentity { - readonly principalId?: string; - type?: string; - readonly tenantId?: string; +export interface VirtualNetworkRule extends ProxyResource { + virtualNetworkSubnetId: string; + ignoreMissingVnetServiceEndpoint?: boolean; + readonly state?: string; } /** * @class - * Initializes a new instance of the Server class. + * Initializes a new instance of the LongTermRetentionBackup class. * @constructor - * An Azure SQL Database server. + * A long term retention backup. * - * @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} [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 Server extends TrackedResource { - identity?: ResourceIdentity; - readonly kind?: string; - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: 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 ServerUpdate class. + * Initializes a new instance of the BackupLongTermRetentionPolicy class. * @constructor - * An update request for an Azure SQL Database server. + * A long term retention policy. * - * @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} [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 ServerUpdate { - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: string; - tags?: { [propertyName: string]: string }; +export interface BackupLongTermRetentionPolicy extends ProxyResource { + weeklyRetention?: string; + monthlyRetention?: string; + yearlyRetention?: string; + weekOfYear?: number; } /** * @class - * Initializes a new instance of the SyncAgent class. + * Initializes a new instance of the AutomaticTuningServerOptions class. * @constructor - * An Azure SQL Database sync agent. + * Automatic tuning properties for individual advisors. * - * @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} [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 SyncAgent extends ProxyResource { - readonly syncAgentName?: string; - syncDatabaseId?: string; - readonly lastAliveTime?: Date; - readonly state?: string; - readonly isUpToDate?: boolean; - readonly expiryTime?: Date; - readonly version?: string; +export interface AutomaticTuningServerOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the SyncAgentKeyProperties class. + * Initializes a new instance of the ServerAutomaticTuning class. * @constructor - * Properties of an Azure SQL Database sync agent key. + * Server-level Automatic Tuning. * - * @member {string} [syncAgentKey] Key of sync agent. + * @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 SyncAgentKeyProperties { - readonly syncAgentKey?: string; +export interface ServerAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningServerOptions }; } /** * @class - * Initializes a new instance of the SyncAgentLinkedDatabase class. + * Initializes a new instance of the ServerDnsAlias class. * @constructor - * An Azure SQL Database sync agent linked database. + * A server DNS alias. * - * @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 {string} [azureDnsRecord] The fully qualified DNS record for alias */ -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 ServerDnsAlias extends ProxyResource { + readonly azureDnsRecord?: string; } /** * @class - * Initializes a new instance of the SyncDatabaseIdProperties class. + * Initializes a new instance of the ServerDnsAliasAcquisition class. * @constructor - * Properties of the sync database id. + * A server DNS alias acquisition request. * - * @member {string} [id] ARM resource id of sync database. + * @member {string} [oldServerDnsAliasId] The id of the server alias that will + * be acquired to point to this server instead. */ -export interface SyncDatabaseIdProperties { - readonly id?: string; +export interface ServerDnsAliasAcquisition { + oldServerDnsAliasId?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaTableColumn class. + * Initializes a new instance of the RestorePoint class. * @constructor - * Properties of the column in the table of database full schema. + * Database restore points. * - * @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 {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 SyncFullSchemaTableColumn { - readonly dataSize?: string; - readonly dataType?: string; - readonly errorId?: string; - readonly hasError?: boolean; - readonly isPrimaryKey?: boolean; - readonly name?: string; - readonly quotedName?: string; +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 SyncFullSchemaTable class. + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. * @constructor - * Properties of the table in the database full schema. + * Contains the information necessary to perform a create database restore + * point operation. * - * @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} restorePointLabel The restore point label to apply */ -export interface SyncFullSchemaTable { - readonly columns?: SyncFullSchemaTableColumn[]; - readonly errorId?: string; - readonly hasError?: boolean; - readonly name?: string; - readonly quotedName?: string; +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaProperties class. + * Initializes a new instance of the DatabaseOperation class. * @constructor - * Properties of the database full schema. + * A database operation. * - * @member {array} [tables] List of tables in the database full schema. - * @member {date} [lastUpdateTime] Last update time of the database schema. + * @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 SyncFullSchemaProperties { - readonly tables?: SyncFullSchemaTable[]; - readonly lastUpdateTime?: Date; +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 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 SyncGroupLogProperties class. + * Initializes a new instance of the ElasticPoolOperation class. * @constructor - * Properties of an Azure SQL Database sync group log. + * A elastic pool operation. * - * @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 {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 SyncGroupLogProperties { - readonly timestamp?: Date; - readonly type?: string; - readonly source?: string; - readonly details?: string; - readonly tracingId?: string; - readonly operationStatus?: string; +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 SyncGroupSchemaTableColumn class. + * Initializes a new instance of the MaxSizeCapability class. * @constructor - * Properties of column in sync group table. + * The maximum size 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 {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 SyncGroupSchemaTableColumn { - quotedName?: string; - dataSize?: string; - dataType?: string; +export interface MaxSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTable class. + * Initializes a new instance of the LogSizeCapability class. * @constructor - * Properties of table in sync group schema. + * The log size 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 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 SyncGroupSchemaTable { - columns?: SyncGroupSchemaTableColumn[]; - quotedName?: string; +export interface LogSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchema class. + * Initializes a new instance of the MaxSizeRangeCapability class. * @constructor - * Properties of sync group schema. + * The maximum size range 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 {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 SyncGroupSchema { - tables?: SyncGroupSchemaTable[]; - masterSyncMemberName?: 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 SyncGroup class. + * Initializes a new instance of the PerformanceLevelCapability class. * @constructor - * An Azure SQL Database sync group. + * The performance level capability. * - * @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. + * @member {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' */ -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 PerformanceLevelCapability { + readonly value?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncMember class. + * Initializes a new instance of the Sku class. * @constructor - * An Azure SQL Database sync member. + * An ARM Resource SKU. * - * @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 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 SyncMember extends ProxyResource { - databaseType?: string; - syncAgentId?: string; - sqlServerDatabaseId?: string; - serverName?: string; - databaseName?: string; - userName?: string; - password?: string; - syncDirection?: string; - readonly syncState?: string; +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; } /** * @class - * Initializes a new instance of the SubscriptionUsage class. + * Initializes a new instance of the LicenseTypeCapability class. * @constructor - * Usage Metric of a Subscription in a Location. + * The license type 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] 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 SubscriptionUsage extends ProxyResource { - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; +export interface LicenseTypeCapability { + readonly name?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the VirtualNetworkRule class. - * @constructor - * A virtual network rule. - * - * @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' + * Initializes a new instance of the ServiceObjectiveCapability class. + * @constructor + * The service objectives capability. + * + * @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 VirtualNetworkRule extends ProxyResource { - virtualNetworkSubnetId: string; - ignoreMissingVnetServiceEndpoint?: boolean; - readonly state?: 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 LongTermRetentionBackup class. + * Initializes a new instance of the EditionCapability class. * @constructor - * A long term retention backup. + * The edition 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] 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 LongTermRetentionBackup extends ProxyResource { - readonly serverName?: string; - readonly serverCreateTime?: Date; - readonly databaseName?: string; - readonly databaseDeletionTime?: Date; - readonly backupTime?: Date; - readonly backupExpirationTime?: Date; +export interface EditionCapability { + readonly name?: string; + readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the BackupLongTermRetentionPolicy class. + * Initializes a new instance of the ElasticPoolPerDatabaseMinPerformanceLevelCapability class. * @constructor - * A long term retention policy. + * The minimum per-database performance level 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 {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 BackupLongTermRetentionPolicy extends ProxyResource { - weeklyRetention?: string; - monthlyRetention?: string; - yearlyRetention?: string; - weekOfYear?: number; +export interface ElasticPoolPerDatabaseMinPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ResourceMoveDefinition class. + * Initializes a new instance of the ElasticPoolPerDatabaseMaxPerformanceLevelCapability class. * @constructor - * Contains the information necessary to perform a resource move (rename). + * The max per-database performance level capability. * - * @member {string} id The target ID for the resource + * @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 ResourceMoveDefinition { - id: 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 AutomaticTuningServerOptions class. + * Initializes a new instance of the ElasticPoolPerformanceLevelCapability class. * @constructor - * Automatic tuning properties for individual advisors. + * The Elastic Pool performance level 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 {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 AutomaticTuningServerOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: string; +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 ServerAutomaticTuning class. + * Initializes a new instance of the ElasticPoolEditionCapability class. * @constructor - * Server-level Automatic Tuning. + * The elastic pool edition capability. * - * @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. + * @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 ServerAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningServerOptions }; +export interface ElasticPoolEditionCapability { + readonly name?: string; + readonly supportedElasticPoolPerformanceLevels?: ElasticPoolPerformanceLevelCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ServerDnsAlias class. + * Initializes a new instance of the ServerVersionCapability class. * @constructor - * A server DNS alias. + * The server capability * - * @member {string} [azureDnsRecord] The fully qualified DNS record for alias + * @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 ServerDnsAlias extends ProxyResource { - readonly azureDnsRecord?: 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 ServerDnsAliasAcquisition class. + * Initializes a new instance of the ManagedInstanceVcoresCapability class. * @constructor - * A server DNS alias acquisition request. + * The managed instance virtual cores capability. * - * @member {string} [oldServerDnsAliasId] The id of the server alias that will - * be acquired to point to this server instead. + * @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 ServerDnsAliasAcquisition { - oldServerDnsAliasId?: string; +export interface ManagedInstanceVcoresCapability { + readonly name?: string; + readonly value?: number; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the RestorePoint class. + * Initializes a new instance of the ManagedInstanceFamilyCapability class. * @constructor - * Database restore points. + * The managed server family capability. * - * @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} [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 RestorePoint extends ProxyResource { - readonly location?: string; - readonly restorePointType?: string; - readonly earliestRestoreDate?: Date; - readonly restorePointCreationDate?: Date; - readonly restorePointLabel?: string; +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 CreateDatabaseRestorePointDefinition class. + * Initializes a new instance of the ManagedInstanceEditionCapability class. * @constructor - * Contains the information necessary to perform a create database restore - * point operation. + * The managed server capability * - * @member {string} restorePointLabel The restore point label to apply + * @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 CreateDatabaseRestorePointDefinition { - restorePointLabel: string; +export interface ManagedInstanceEditionCapability { + readonly name?: string; + readonly supportedFamilies?: ManagedInstanceFamilyCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the DatabaseOperation class. + * Initializes a new instance of the ManagedInstanceVersionCapability class. * @constructor - * A database operation. + * The managed instance capability * - * @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. + * @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 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 errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; +export interface ManagedInstanceVersionCapability { + readonly name?: string; + readonly supportedEditions?: ManagedInstanceEditionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ElasticPoolOperation class. + * Initializes a new instance of the LocationCapabilities class. * @constructor - * A elastic pool operation. + * The location capability. * - * @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. + * @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 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 LocationCapabilities { + readonly name?: string; + readonly supportedServerVersions?: ServerVersionCapability[]; + readonly supportedManagedInstanceVersions?: ManagedInstanceVersionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the Sku class. + * Initializes a new instance of the Database class. * @constructor - * An ARM Resource SKU. + * A database resource. * - * @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 + * @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} [capacity] Capacity of the particular SKU. + * @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. + * + * 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 Sku { - name?: string; - tier?: string; - size?: string; - family?: string; - capacity?: number; +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 VulnerabilityAssessmentRecurringScansProperties class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * Properties of a Vulnerability Assessment recurring scans. + * 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. + * + * 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. * - * @member {boolean} [isEnabled] Recurring scans state. - * @member {boolean} [emailSubscriptionAdmins] Specifies that the schedule scan - * notification will be is sent to the subscription administrators. Default - * value: true . - * @member {array} [emails] Specifies an array of e-mail addresses to which the - * scan notification is sent. + * 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 VulnerabilityAssessmentRecurringScansProperties { - isEnabled?: boolean; - emailSubscriptionAdmins?: boolean; - emails?: 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 DatabaseVulnerabilityAssessment class. + * Initializes a new instance of the ResourceMoveDefinition class. * @constructor - * A database vulnerability assessment. + * Contains the information necessary to perform a resource move (rename). * - * @member {string} [storageContainerPath] A blob storage container path to - * hold the scan results (e.g. - * https://myStorage.blob.core.windows.net/VaScans/). - * @member {string} [storageContainerSasKey] A shared access signature (SAS - * Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. - * @member {object} [recurringScans] The recurring scans settings - * @member {boolean} [recurringScans.isEnabled] Recurring scans state. - * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that - * the schedule scan notification will be is sent to the subscription - * administrators. - * @member {array} [recurringScans.emails] Specifies an array of e-mail - * addresses to which the scan notification is sent. + * @member {string} id The target ID for the resource */ -export interface DatabaseVulnerabilityAssessment extends ProxyResource { - storageContainerPath?: string; - storageContainerSasKey?: string; - recurringScans?: VulnerabilityAssessmentRecurringScansProperties; +export interface ResourceMoveDefinition { + id: string; } /** * @class - * Initializes a new instance of the VulnerabilityAssessmentScanError class. + * Initializes a new instance of the ElasticPoolPerDatabaseSettings class. * @constructor - * Properties of a vulnerability assessment scan error. + * Per database settings of an elastic pool. * - * @member {string} [code] The error code. - * @member {string} [message] The error message. + * @member {number} [minCapacity] The minimum capacity all databases are + * guaranteed. + * @member {number} [maxCapacity] The maximum capacity any one database can + * consume. */ -export interface VulnerabilityAssessmentScanError { - readonly code?: string; - readonly message?: string; +export interface ElasticPoolPerDatabaseSettings { + minCapacity?: number; + maxCapacity?: number; } /** * @class - * Initializes a new instance of the VulnerabilityAssessmentScanRecord class. + * Initializes a new instance of the ElasticPool class. * @constructor - * A vulnerability assessment scan record. + * An elastic pool. * - * @member {string} [scanId] The scan ID. - * @member {string} [triggerType] The scan trigger type. Possible values - * include: 'OnDemand', 'Recurring' - * @member {string} [state] The scan status. Possible values include: 'Passed', - * 'Failed', 'FailedToRun', 'InProgress' - * @member {date} [startTime] The scan start time (UTC). - * @member {date} [endTime] The scan end time (UTC). - * @member {array} [errors] The scan errors. - * @member {string} [storageContainerPath] The scan results storage container - * path. - * @member {number} [numberOfFailedSecurityChecks] The number of failed - * security checks. + * @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 VulnerabilityAssessmentScanRecord extends ProxyResource { - readonly scanId?: string; - readonly triggerType?: string; +export interface ElasticPool extends TrackedResource { + sku?: Sku; + readonly kind?: string; readonly state?: string; - readonly startTime?: Date; - readonly endTime?: Date; - readonly errors?: VulnerabilityAssessmentScanError[]; - readonly storageContainerPath?: string; - readonly numberOfFailedSecurityChecks?: number; + readonly creationDate?: Date; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; } /** * @class - * Initializes a new instance of the DatabaseVulnerabilityAssessmentScansExport class. + * Initializes a new instance of the ElasticPoolUpdate class. * @constructor - * A database Vulnerability Assessment scan export resource. + * An elastic pool update. * - * @member {string} [exportedReportLocation] Location of the exported report - * (e.g. - * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + * @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 DatabaseVulnerabilityAssessmentScansExport extends ProxyResource { - readonly exportedReportLocation?: string; +export interface ElasticPoolUpdate { + sku?: Sku; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; + tags?: { [propertyName: string]: string }; } @@ -2813,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 { } /** @@ -2843,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 { } /** @@ -2941,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. @@ -3217,15 +3296,3 @@ export interface DatabaseOperationListResult extends Array { export interface ElasticPoolOperationListResult extends Array { readonly nextLink?: string; } - -/** - * @class - * Initializes a new instance of the VulnerabilityAssessmentScanRecordListResult class. - * @constructor - * A list of vulnerability assessment scan records. - * - * @member {string} [nextLink] Link to retrieve next page of results. - */ -export interface VulnerabilityAssessmentScanRecordListResult extends Array { - readonly nextLink?: string; -} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 1d58d1b5e3..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,30 +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.VulnerabilityAssessmentRecurringScansProperties = require('./vulnerabilityAssessmentRecurringScansProperties'); -exports.DatabaseVulnerabilityAssessment = require('./databaseVulnerabilityAssessment'); -exports.VulnerabilityAssessmentScanError = require('./vulnerabilityAssessmentScanError'); -exports.VulnerabilityAssessmentScanRecord = require('./vulnerabilityAssessmentScanRecord'); -exports.DatabaseVulnerabilityAssessmentScansExport = require('./databaseVulnerabilityAssessmentScansExport'); +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'); @@ -156,4 +160,3 @@ exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); -exports.VulnerabilityAssessmentScanRecordListResult = require('./vulnerabilityAssessmentScanRecordListResult'); 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 index b0e24e9236..698c630dff 100644 --- a/lib/services/sqlManagement2/lib/models/sku.js +++ b/lib/services/sqlManagement2/lib/models/sku.js @@ -17,7 +17,7 @@ class Sku { /** * Create a Sku. - * @member {string} [name] The name of the SKU, typically, a letter + Number + * @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. @@ -44,7 +44,7 @@ class Sku { className: 'Sku', modelProperties: { name: { - required: false, + required: true, serializedName: 'name', type: { name: 'String' 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 b31cbf2662..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 {object} parameters The required parameters for updating a database. + * @param {string} dataMaskingRuleName The name of the data masking rule. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @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' * - * Default: regular database creation. + * @param {string} parameters.schemaName The schema 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.tableName The table 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.columnName The column name on which the data + * masking rule is applied. * - * 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.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' * - * 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.numberFrom] The numberFrom property of the + * 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.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, 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.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. * - * 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.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 + * + * @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,20 +2447,30 @@ 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 @@ -2572,10 +2478,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. * @@ -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. * - * @param {string} parameters.storageUri The storage uri to use. + * @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} 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 {ServiceCallback} [optionalCallback] - The optional callback. + * @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. * - * @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 required parameters for creating or updating - * a 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.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. @@ -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 {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. * @@ -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 required parameters for creating or updating - * a database. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @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. @@ -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.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.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.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 + * 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} 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 {object} parameters The required parameters for updating a database. + * @param {string} databaseName The name of the database to be resumed. * - * @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,89 +4463,212 @@ 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 + * 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 + * + * @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. * - * @param {string} resourceGroupName 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} [options] Optional Parameters. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @returns {Promise} A promise is returned + * @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,96 +4877,153 @@ 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 * 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 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. * - * @param {string} databaseName The name of the database. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.collation] The collation of the database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @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.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of 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 {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} serverName The name of the server. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} databaseName The name of the database. + * @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 {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * {Promise} A promise is returned. + * @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. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @reject {Error|ServiceError} - The error object. + * @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' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.tags] Resource tags. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options] Optional Parameters. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @returns {Promise} A promise is returned * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @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} [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. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * {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. + * Gets a list of databases in an elastic pool. * - * @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. * @@ -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. - * - * @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 a list of databases in an elastic pool. * - * @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,20 +5911,19 @@ 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 @@ -5814,31 +5931,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.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @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.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for 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 {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. * @@ -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 elastic pool update parameters. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {object} [parameters.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.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.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @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.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @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.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. * @@ -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. + * 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 {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; + 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; } /** @@ -7978,233 +8231,22 @@ export interface ElasticPoolActivities { * * {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 { - - - /** - * 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 - * 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>; - - /** - * 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 - * 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 {ElasticPoolDatabaseActivityListResult} - 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. - * - * {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. - */ - 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 { - - - /** - * 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 - * 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. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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 - * 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 {RecommendedElasticPool} - 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. - * - * {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. - */ - 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; - - - /** - * 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 - * 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 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 - * 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 {RecommendedElasticPoolListResult} - 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. - * - * {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. - */ - 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; } /** @@ -14803,227 +14843,20 @@ export interface SubscriptionUsages { * * {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?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocation(locationName: string, callback: ServiceCallback): void; - listByLocation(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * 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|ServiceError} - The error object. - */ - getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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 {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 {SubscriptionUsage} - 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. - * - * {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. - */ - 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; - - - /** - * 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|ServiceError} - The error object. - */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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 {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 {SubscriptionUsageListResult} - 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. - * - * {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. - */ - 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 - * VirtualNetworkRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface VirtualNetworkRules { - - - /** - * Gets a 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 - * 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. - * - * @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, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a 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 - * 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. - * - * @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 {VirtualNetworkRule} - 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. - * - * {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. - */ - 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; - - - /** - * 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 - * 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} parameters The requested virtual Network Rule Resource - * state. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + 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; + + + /** + * Gets a subscription usage metric. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -15032,31 +14865,19 @@ 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(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * 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} parameters The requested virtual Network Rule Resource - * state. + * Gets a subscription usage metric. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -15070,7 +14891,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {SubscriptionUsage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15078,28 +14899,23 @@ 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. + * {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. */ - 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(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; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets all subscription usage metrics in a given location. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15108,22 +14924,17 @@ 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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets all subscription usage metrics in a given location. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15137,7 +14948,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15145,19 +14956,30 @@ 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. + * {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. */ - 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; + 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 + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface VirtualNetworkRules { /** - * Gets a list of virtual network rules in a server. + * Gets a 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 @@ -15165,6 +14987,8 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15172,14 +14996,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Gets a 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 @@ -15187,6 +15011,8 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15199,7 +15025,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15207,17 +15033,16 @@ 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. + * {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. */ - 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, 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; /** @@ -15251,7 +15076,7 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates or updates an existing virtual network rule. @@ -15300,9 +15125,9 @@ export interface VirtualNetworkRules { * * {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; + 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; /** @@ -15327,7 +15152,7 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes the virtual network rule with the given name. @@ -15366,16 +15191,19 @@ export interface VirtualNetworkRules { * * {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; + 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 list of virtual network rules in a server. * - * @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. * @@ -15388,13 +15216,16 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets a list of virtual network rules in a server. * - * @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. * @@ -15424,98 +15255,30 @@ export interface VirtualNetworkRules { * * {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 - * LongTermRetentionBackups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface LongTermRetentionBackups { - + 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 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|ServiceError} - The error object. - */ - getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 {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 {LongTermRetentionBackup} - 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. - * - * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackup} for more - * information. + * Creates or updates an existing virtual network rule. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - 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 long term retention backup. + * @param {string} serverName The name of the server. * - * @param {string} locationName The location of the database + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} longTermRetentionServerName + * @param {object} parameters The requested virtual Network Rule Resource + * state. * - * @param {string} longTermRetentionDatabaseName + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. * - * @param {string} backupName The backup name. + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -15524,22 +15287,31 @@ export interface LongTermRetentionBackups { * * @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(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. + * Creates or updates an existing virtual network rule. * - * @param {string} locationName The location 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 {string} longTermRetentionServerName + * @param {string} serverName The name of the server. * - * @param {string} longTermRetentionDatabaseName + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} backupName The backup name. + * @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. * @@ -15553,7 +15325,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15561,64 +15333,55 @@ export interface LongTermRetentionBackups { * * {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. */ - 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; + 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; /** - * Lists all long term retention backups for a database. + * Deletes the virtual network rule with the given name. * - * @param {string} locationName The location 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 {string} longTermRetentionServerName + * @param {string} serverName The name of the server. * - * @param {string} longTermRetentionDatabaseName + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. + * Deletes the virtual network rule with the given name. * - * @param {string} locationName The location 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 {string} longTermRetentionServerName + * @param {string} serverName The name of the server. * - * @param {string} longTermRetentionDatabaseName + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @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 * @@ -15629,7 +15392,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15637,58 +15400,44 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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(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; + 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; /** - * Lists the long term retention backups for a given location. + * Gets a list of virtual network rules in a server. * - * @param {string} locationName The location of the database + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Gets a list of virtual network rules in a server. * - * @param {string} locationName The location of the database + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @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 * @@ -15699,7 +15448,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15707,61 +15456,64 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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. */ - 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; + 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 { /** - * Lists the long term retention backups for a given server. + * Gets a long term retention backup. * - * @param {string} locationName The location of the database + * @param {string} locationName The location of the database. * * @param {string} longTermRetentionServerName * - * @param {object} [options] Optional Parameters. + * @param {string} longTermRetentionDatabaseName * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} backupName The backup name. * - * @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] 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(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. + * Gets a long term retention backup. * - * @param {string} locationName The location of the database + * @param {string} locationName The location of the database. * * @param {string} longTermRetentionServerName * - * @param {object} [options] Optional Parameters. + * @param {string} longTermRetentionDatabaseName * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} backupName The backup name. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15773,7 +15525,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15781,17 +15533,17 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {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. */ - 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; + 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; /** @@ -15816,7 +15568,7 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a long term retention backup. @@ -15855,76 +15607,28 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** * 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. + * @param {string} locationName The location of the database * - * @reject {Error|ServiceError} - The error object. - */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all long term retention backups for a database. + * @param {string} longTermRetentionServerName * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} longTermRetentionDatabaseName * * @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 {LongTermRetentionBackupListResult} - 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. - * - * {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. - */ - 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; - - - /** - * Lists the long term retention backups for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 @@ -15935,16 +15639,26 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Lists all long term retention backups for a database. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -15971,19 +15685,25 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 the long term retention backups for a given server. + * Lists the long term retention backups for a given location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -15993,16 +15713,22 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. + * Lists the long term retention backups for a given location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -16029,57 +15755,54 @@ export interface LongTermRetentionBackups { * * {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 - * BackupLongTermRetentionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface BackupLongTermRetentionPolicies { + 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; /** - * 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. + * Lists the long term retention backups for a given server. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name 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. + * @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(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Lists the long term retention backups for a given server. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name 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 * @@ -16090,7 +15813,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16098,43 +15821,29 @@ 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 + * {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. */ - 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; + 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; /** - * 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. + * Deletes a long term retention backup. * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} locationName The location of the database * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. + * @param {string} longTermRetentionServerName * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} longTermRetentionDatabaseName * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -16143,36 +15852,22 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Deletes a long term retention backup. * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} locationName The location of the database * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. + * @param {string} longTermRetentionServerName * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} longTermRetentionDatabaseName * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -16186,7 +15881,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16194,29 +15889,22 @@ 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. + * {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.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; + 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; /** - * 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. + * Lists all long term retention backups for a database. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16225,22 +15913,17 @@ 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. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Lists all long term retention backups for a database. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16254,7 +15937,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16262,43 +15945,24 @@ 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 + * {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; + 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; /** - * 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. + * Lists the long term retention backups for a given location. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16307,36 +15971,17 @@ export interface BackupLongTermRetentionPolicies { * * @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.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @reject {Error|ServiceError} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. * @@ -16350,7 +15995,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16358,36 +16003,24 @@ 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 + * {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. */ - 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 { + 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; /** - * 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. + * Lists the long term retention backups for a given 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. * @@ -16396,20 +16029,17 @@ export interface ServerAutomaticTuningOperations { * * @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>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Lists the long term retention backups for a given 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. * @@ -16423,7 +16053,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16431,20 +16061,30 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} 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. */ - 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; + 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 { /** - * Update automatic tuning options on server. + * 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 @@ -16452,12 +16092,7 @@ export interface ServerAutomaticTuningOperations { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16466,14 +16101,14 @@ export interface ServerAutomaticTuningOperations { * * @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.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update automatic tuning options on server. + * 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 @@ -16481,12 +16116,7 @@ export interface ServerAutomaticTuningOperations { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16500,7 +16130,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16508,38 +16138,43 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} 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. */ - 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 { + 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 server DNS alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @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. * @@ -16548,23 +16183,36 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: 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 server DNS alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @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. * @@ -16578,7 +16226,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16586,29 +16234,29 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} 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, 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; + 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; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16617,23 +16265,22 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16647,7 +16294,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16655,29 +16302,43 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} 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. */ - 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; + 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 the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @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. * @@ -16686,23 +16347,36 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @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 {string} dnsAliasName The name of the server DNS alias. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -16716,7 +16390,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16724,26 +16398,36 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 { /** - * Gets a list of server DNS aliases for a server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -16752,21 +16436,20 @@ export interface ServerDnsAliases { * * @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 server DNS aliases for a server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -16780,7 +16463,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16788,35 +16471,33 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} 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. */ - 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, 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; /** - * Acquires server DNS alias from another server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server dns alias. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {object} parameters + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -16825,28 +16506,27 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server dns alias. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {object} parameters + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -16860,7 +16540,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16868,19 +16548,29 @@ export interface ServerDnsAliases { * * {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. */ - 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; + 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 { /** - * Creates a server dns alias. + * 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 @@ -16902,10 +16592,10 @@ export interface ServerDnsAliases { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server dns alias. + * 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 @@ -16943,13 +16633,13 @@ export interface ServerDnsAliases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * Deletes the server DNS alias with the given name. + * 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 @@ -16967,14 +16657,14 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 @@ -16997,7 +16687,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17005,19 +16695,20 @@ export interface ServerDnsAliases { * * {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, 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; + 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; /** - * Acquires server DNS alias from another server. + * 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 @@ -17026,12 +16717,7 @@ export interface ServerDnsAliases { * @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 {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17044,10 +16730,10 @@ export interface ServerDnsAliases { * * @reject {Error|ServiceError} - The error object. */ - beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another server. + * 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 @@ -17056,12 +16742,7 @@ export interface ServerDnsAliases { * @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 {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17089,16 +16770,20 @@ export interface ServerDnsAliases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** * Gets a list of server DNS aliases for a server. * - * @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 that the alias is pointing + * to. * * @param {object} [options] Optional Parameters. * @@ -17111,13 +16796,17 @@ export interface ServerDnsAliases { * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets a list of server DNS aliases for a server. * - * @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 that the alias is pointing + * to. * * @param {object} [options] Optional Parameters. * @@ -17147,30 +16836,27 @@ export interface ServerDnsAliases { * * {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 - * RestorePoints - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorePoints { + 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 database restore points. + * 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. + * @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. * @@ -17179,22 +16865,28 @@ 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>; + acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database restore points. + * 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. + * @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. * @@ -17208,7 +16900,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePointListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17216,35 +16908,28 @@ 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. + * {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; + 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; /** - * Creates a restore point for a data warehouse. + * 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. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17253,28 +16938,23 @@ 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. */ - createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a restore point for a data warehouse. + * 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. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17288,7 +16968,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17296,30 +16976,29 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} 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. */ - 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; + 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; /** - * Gets a restore point. + * 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. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} restorePointName The name of the restore point. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17328,24 +17007,23 @@ 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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a restore point. + * 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. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} restorePointName The name of the restore point. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -17359,7 +17037,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17367,30 +17045,33 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} 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, 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; + 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; /** - * Deletes a restore point. + * 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. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} restorePointName The name of the restore point. + * @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. * @@ -17403,20 +17084,24 @@ export interface RestorePoints { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a restore point. + * 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. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} restorePointName The name of the restore point. + * @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. * @@ -17444,27 +17129,16 @@ export interface RestorePoints { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * 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. + * Gets a list of server DNS aliases for a server. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17473,28 +17147,17 @@ 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. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of server DNS aliases for a server. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17508,7 +17171,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17516,29 +17179,30 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} 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. */ - 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; + 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 - * DatabaseOperations + * RestorePoints * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseOperations { +export interface RestorePoints { /** - * Cancels the asynchronous operation on the database. + * 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 @@ -17548,8 +17212,6 @@ export interface DatabaseOperations { * * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17557,14 +17219,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. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * 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 @@ -17574,8 +17236,6 @@ export interface DatabaseOperations { * * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17588,7 +17248,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RestorePointListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17596,19 +17256,21 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 operations performed on the database. + * 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 @@ -17618,6 +17280,12 @@ export interface DatabaseOperations { * * @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 @@ -17625,14 +17293,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>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * 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 @@ -17642,6 +17310,12 @@ export interface DatabaseOperations { * * @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 @@ -17654,7 +17328,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17662,24 +17336,30 @@ 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 - * 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. */ - 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; + 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; /** - * Gets a list of operations performed on the database. + * Gets a restore point. * - * @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 {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -17688,17 +17368,24 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a restore point. * - * @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 {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -17712,7 +17399,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17720,30 +17407,20 @@ 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 - * 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. */ - 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 - * ElasticPoolOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolOperations { + 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; /** - * Cancels the asynchronous operation on the elastic pool. + * 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 @@ -17751,9 +17428,9 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -17766,10 +17443,10 @@ export interface ElasticPoolOperations { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the elastic pool. + * 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 @@ -17777,9 +17454,9 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -17807,13 +17484,13 @@ export interface ElasticPoolOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 operations performed on the elastic pool. + * 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 @@ -17821,7 +17498,13 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @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. * @@ -17830,14 +17513,14 @@ export interface ElasticPoolOperations { * * @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>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * 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 @@ -17845,7 +17528,13 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @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. * @@ -17859,7 +17548,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17867,24 +17556,39 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} 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. */ - 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; + 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 { /** - * Gets a list of operations performed on the elastic pool. + * Cancels the asynchronous operation on the database. * - * @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 {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -17893,17 +17597,24 @@ export interface ElasticPoolOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * Cancels the asynchronous operation on the database. * - * @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 {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -17917,7 +17628,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17925,30 +17636,19 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} 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. */ - 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 - * DatabaseVulnerabilityAssessmentScans - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseVulnerabilityAssessmentScans { + 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; /** - * Gets a vulnerability assessment scan record of a database. + * 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 @@ -17958,9 +17658,6 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @param {string} databaseName The name of the database. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17968,14 +17665,14 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @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, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a vulnerability assessment scan record of a database. + * 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 @@ -17985,9 +17682,6 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @param {string} databaseName The name of the database. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18000,7 +17694,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {VulnerabilityAssessmentScanRecord} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18008,32 +17702,24 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VulnerabilityAssessmentScanRecord} [result] - The deserialized result object if an error did not occur. - * See {@link VulnerabilityAssessmentScanRecord} 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. */ - get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, scanId: 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; /** - * Executes a Vulnerability Assessment database scan. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. + * Gets a list of operations performed on the database. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18042,25 +17728,17 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - executeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Executes a Vulnerability Assessment database scan. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. + * Gets a list of operations performed on the database. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18074,7 +17752,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18082,19 +17760,30 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {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. */ - execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; - execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: 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 + * ElasticPoolOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolOperations { /** - * Lists the vulnerability assessment scans of a 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 @@ -18102,7 +17791,9 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @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. * * @param {object} [options] Optional Parameters. * @@ -18111,14 +17802,14 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @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>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the vulnerability assessment scans of a 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 @@ -18126,7 +17817,9 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @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. * * @param {object} [options] Optional Parameters. * @@ -18140,7 +17833,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {VulnerabilityAssessmentScanRecordListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18148,22 +17841,19 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VulnerabilityAssessmentScanRecordListResult} - * 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; + 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; /** - * Convert an existing scan result to a human readable format. If already - * exists nothing happens + * 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 @@ -18171,9 +17861,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the scanned database. - * - * @param {string} scanId The vulnerability assessment scan Id. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -18182,15 +17870,14 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @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, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Convert an existing scan result to a human readable format. If already - * exists nothing happens + * 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 @@ -18198,9 +17885,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the scanned database. - * - * @param {string} scanId The vulnerability assessment scan Id. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -18214,7 +17899,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {DatabaseVulnerabilityAssessmentScansExport} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18222,32 +17907,24 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseVulnerabilityAssessmentScansExport} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseVulnerabilityAssessmentScansExport} - * for more information. + * {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. */ - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: 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; /** - * Executes a Vulnerability Assessment database scan. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. + * Gets a list of operations performed on the elastic pool. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18256,25 +17933,17 @@ export interface DatabaseVulnerabilityAssessmentScans { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginExecuteWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Executes a Vulnerability Assessment database scan. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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. + * Gets a list of operations performed on the elastic pool. * - * @param {string} scanId The vulnerability assessment scan Id of the scan to - * retrieve. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -18288,7 +17957,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18296,44 +17965,65 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; - beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: 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; +} + +/** + * @class + * Capabilities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Capabilities { /** - * Lists the vulnerability assessment scans of a database. + * Gets the subscription capabilities available for the specified location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the vulnerability assessment scans of a database. + * Gets the subscription capabilities available for the specified location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -18344,7 +18034,7 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Promise} A promise is returned. * - * @resolve {VulnerabilityAssessmentScanRecordListResult} - The deserialized result object. + * @resolve {LocationCapabilities} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18352,15 +18042,14 @@ export interface DatabaseVulnerabilityAssessmentScans { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VulnerabilityAssessmentScanRecordListResult} - * 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. */ - 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; + 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 10f0351dcc..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,4 +55,4 @@ exports.ServerDnsAliases = require('./serverDnsAliases'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); -exports.DatabaseVulnerabilityAssessmentScans = require('./databaseVulnerabilityAssessmentScans'); +exports.Capabilities = require('./capabilities'); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 3899db5f5b..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,7 +95,7 @@ export default class SqlManagementClient extends AzureServiceClient { restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; - databaseVulnerabilityAssessmentScans: operations.DatabaseVulnerabilityAssessmentScans; + 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 732c918db9..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,7 +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.databaseVulnerabilityAssessmentScans = new operations.DatabaseVulnerabilityAssessmentScans(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..d5e5b8a331 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.2", + "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" } } From faf9dc8a05a6be3bf8d8c6bb4e610afe5a833a84 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 23 Apr 2018 10:41:16 +0000 Subject: [PATCH 3/4] Generated from 7d497dcd6c622203007892c5314ac8bf92744ee6 Merge branch 'master' into master --- .../completeDatabaseRestoreDefinition.js | 53 + .../sqlManagement2/lib/models/index.d.ts | 445 +- .../sqlManagement2/lib/models/index.js | 18 +- .../lib/models/instanceFailoverGroup.js | 158 + .../models/instanceFailoverGroupListResult.js | 69 + .../instanceFailoverGroupReadOnlyEndpoint.js | 54 + .../instanceFailoverGroupReadWriteEndpoint.js | 66 + .../lib/models/managedDatabase.js | 213 + .../lib/models/managedDatabaseListResult.js | 69 + .../lib/models/managedDatabaseUpdate.js | 179 + .../lib/models/managedInstance.js | 198 + .../lib/models/managedInstanceListResult.js | 69 + .../lib/models/managedInstancePairInfo.js | 62 + .../lib/models/managedInstanceUpdate.js | 149 + .../lib/models/partnerRegionInfo.js | 62 + .../lib/models/shortTermRetentionPolicy.js | 81 + .../sqlManagement2/lib/operations/index.d.ts | 8199 ++++++++++++----- .../sqlManagement2/lib/operations/index.js | 4 + .../lib/operations/instanceFailoverGroups.js | 2634 ++++++ .../lib/operations/managedDatabases.js | 2851 ++++++ .../lib/operations/managedInstances.js | 2862 ++++++ .../operations/shortTermRetentionPolicies.js | 1231 +++ .../lib/sqlManagementClient.d.ts | 4 + .../sqlManagement2/lib/sqlManagementClient.js | 4 + 24 files changed, 17238 insertions(+), 2496 deletions(-) create mode 100644 lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js create mode 100644 lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js create mode 100644 lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js create mode 100644 lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js create mode 100644 lib/services/sqlManagement2/lib/models/managedDatabase.js create mode 100644 lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstance.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceListResult.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js create mode 100644 lib/services/sqlManagement2/lib/models/partnerRegionInfo.js create mode 100644 lib/services/sqlManagement2/lib/models/shortTermRetentionPolicy.js create mode 100644 lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js create mode 100644 lib/services/sqlManagement2/lib/operations/managedDatabases.js create mode 100644 lib/services/sqlManagement2/lib/operations/managedInstances.js create mode 100644 lib/services/sqlManagement2/lib/operations/shortTermRetentionPolicies.js diff --git a/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js b/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js new file mode 100644 index 0000000000..65d3fbb01b --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.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 complete database restore + * operation. + * + */ +class CompleteDatabaseRestoreDefinition { + /** + * Create a CompleteDatabaseRestoreDefinition. + * @member {string} lastBackupName The last backup name to apply + */ + constructor() { + } + + /** + * Defines the metadata of CompleteDatabaseRestoreDefinition + * + * @returns {object} metadata of CompleteDatabaseRestoreDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'CompleteDatabaseRestoreDefinition', + type: { + name: 'Composite', + className: 'CompleteDatabaseRestoreDefinition', + modelProperties: { + lastBackupName: { + required: true, + serializedName: 'lastBackupName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CompleteDatabaseRestoreDefinition; diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index e291789c89..363749ddaa 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -1292,6 +1292,140 @@ export interface FailoverGroupUpdate { tags?: { [propertyName: string]: string }; } +/** + * @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; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * An ARM Resource 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. + */ +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the ManagedInstance class. + * @constructor + * An Azure SQL managed instance. + * + * @member {object} [identity] The Azure Active Directory identity of the + * managed instance. + * @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 {object} [sku] Managed instance 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} [fullyQualifiedDomainName] The fully qualified domain name + * of the managed instance. + * @member {string} [administratorLogin] Administrator username for the managed + * instance. Can only be specified when the managed instance is being created + * (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + */ +export interface ManagedInstance extends TrackedResource { + identity?: ResourceIdentity; + sku?: Sku; + readonly fullyQualifiedDomainName?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + subnetId?: string; + readonly state?: string; + licenseType?: string; + vCores?: number; + storageSizeInGB?: number; +} + +/** + * @class + * Initializes a new instance of the ManagedInstanceUpdate class. + * @constructor + * An update request for an Azure SQL Database managed instance. + * + * @member {object} [sku] Managed instance 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} [fullyQualifiedDomainName] The fully qualified domain name + * of the managed instance. + * @member {string} [administratorLogin] Administrator username for the managed + * instance. Can only be specified when the managed instance is being created + * (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + * @member {object} [tags] Resource tags. + */ +export interface ManagedInstanceUpdate { + sku?: Sku; + readonly fullyQualifiedDomainName?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + subnetId?: string; + readonly state?: string; + licenseType?: string; + vCores?: number; + storageSizeInGB?: number; + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the OperationDisplay class. @@ -1368,24 +1502,6 @@ export interface ServerKey extends ProxyResource { 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; -} - /** * @class * Initializes a new instance of the Server class. @@ -1809,6 +1925,125 @@ export interface BackupLongTermRetentionPolicy extends ProxyResource { weekOfYear?: number; } +/** + * @class + * Initializes a new instance of the CompleteDatabaseRestoreDefinition class. + * @constructor + * Contains the information necessary to perform a complete database restore + * operation. + * + * @member {string} lastBackupName The last backup name to apply + */ +export interface CompleteDatabaseRestoreDefinition { + lastBackupName: string; +} + +/** + * @class + * Initializes a new instance of the ManagedDatabase class. + * @constructor + * A managed database resource. + * + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values include: + * 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + */ +export interface ManagedDatabase extends TrackedResource { + collation?: string; + readonly status?: string; + readonly creationDate?: Date; + readonly earliestRestorePoint?: Date; + restorePointInTime?: Date; + readonly defaultSecondaryLocation?: string; + catalogCollation?: string; + createMode?: string; + storageContainerUri?: string; + sourceDatabaseId?: string; + storageContainerSasToken?: string; + readonly failoverGroupId?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedDatabaseUpdate class. + * @constructor + * An managed database update. + * + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values include: + * 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + * @member {object} [tags] Resource tags. + */ +export interface ManagedDatabaseUpdate { + collation?: string; + readonly status?: string; + readonly creationDate?: Date; + readonly earliestRestorePoint?: Date; + restorePointInTime?: Date; + readonly defaultSecondaryLocation?: string; + catalogCollation?: string; + createMode?: string; + storageContainerUri?: string; + sourceDatabaseId?: string; + storageContainerSasToken?: string; + readonly failoverGroupId?: string; + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the AutomaticTuningServerOptions class. @@ -2082,28 +2317,6 @@ export interface PerformanceLevelCapability { readonly unit?: string; } -/** - * @class - * Initializes a new instance of the Sku class. - * @constructor - * An ARM Resource 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. - */ -export interface Sku { - name: string; - tier?: string; - size?: string; - family?: string; - capacity?: number; -} - /** * @class * Initializes a new instance of the LicenseTypeCapability class. @@ -2853,6 +3066,122 @@ export interface ElasticPoolUpdate { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupReadWriteEndpoint class. + * @constructor + * Read-write endpoint of the failover group instance. + * + * @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 InstanceFailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; +} + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupReadOnlyEndpoint class. + * @constructor + * Read-only endpoint of the failover group instance. + * + * @member {string} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' + */ +export interface InstanceFailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; +} + +/** + * @class + * Initializes a new instance of the PartnerRegionInfo class. + * @constructor + * Partner region information for the failover group. + * + * @member {string} [location] Geo location of the partner managed instances. + * @member {string} [replicationRole] Replication role of the partner managed + * instances. Possible values include: 'Primary', 'Secondary' + */ +export interface PartnerRegionInfo { + location?: string; + readonly replicationRole?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedInstancePairInfo class. + * @constructor + * Pairs of Managed Instances in the failover group. + * + * @member {string} [primaryManagedInstanceId] Id of Primary Managed Instance + * in pair. + * @member {string} [partnerManagedInstanceId] Id of Partner Managed Instance + * in pair. + */ +export interface ManagedInstancePairInfo { + primaryManagedInstanceId?: string; + partnerManagedInstanceId?: string; +} + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroup class. + * @constructor + * An instance failover group. + * + * @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} partnerRegions Partner region information for the failover + * group. + * @member {array} managedInstancePairs List of managed instance pairs in the + * failover group. + */ +export interface InstanceFailoverGroup extends ProxyResource { + readWriteEndpoint: InstanceFailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: InstanceFailoverGroupReadOnlyEndpoint; + readonly replicationRole?: string; + readonly replicationState?: string; + partnerRegions: PartnerRegionInfo[]; + managedInstancePairs: ManagedInstancePairInfo[]; +} + +/** + * @class + * Initializes a new instance of the ShortTermRetentionPolicy class. + * @constructor + * A short term retention policy resource. + * + * @member {number} [retentionDays] The backup retention period in days. This + * is how many days Point-in-Time Restore will be supported. + */ +export interface ShortTermRetentionPolicy extends ProxyResource { + retentionDays?: number; +} + /** * @class @@ -3105,6 +3434,18 @@ export interface FailoverGroupListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the ManagedInstanceListResult class. + * @constructor + * A list of managed instances. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ManagedInstanceListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the OperationListResult class. @@ -3249,6 +3590,18 @@ export interface LongTermRetentionBackupListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the ServerDnsAliasListResult class. @@ -3296,3 +3649,15 @@ export interface DatabaseOperationListResult extends Array { export interface ElasticPoolOperationListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupListResult class. + * @constructor + * A list of instance failover groups. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface InstanceFailoverGroupListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index eb58f54c80..86aa7c826a 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -65,10 +65,13 @@ exports.FailoverGroupReadOnlyEndpoint = require('./failoverGroupReadOnlyEndpoint exports.PartnerInfo = require('./partnerInfo'); exports.FailoverGroup = require('./failoverGroup'); exports.FailoverGroupUpdate = require('./failoverGroupUpdate'); +exports.ResourceIdentity = require('./resourceIdentity'); +exports.Sku = require('./sku'); +exports.ManagedInstance = require('./managedInstance'); +exports.ManagedInstanceUpdate = require('./managedInstanceUpdate'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); exports.ServerKey = require('./serverKey'); -exports.ResourceIdentity = require('./resourceIdentity'); exports.Server = require('./server'); exports.ServerUpdate = require('./serverUpdate'); exports.SyncAgent = require('./syncAgent'); @@ -88,6 +91,9 @@ exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); exports.LongTermRetentionBackup = require('./longTermRetentionBackup'); exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); +exports.CompleteDatabaseRestoreDefinition = require('./completeDatabaseRestoreDefinition'); +exports.ManagedDatabase = require('./managedDatabase'); +exports.ManagedDatabaseUpdate = require('./managedDatabaseUpdate'); exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions'); exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); exports.ServerDnsAlias = require('./serverDnsAlias'); @@ -100,7 +106,6 @@ 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'); @@ -120,6 +125,12 @@ exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); exports.ElasticPoolPerDatabaseSettings = require('./elasticPoolPerDatabaseSettings'); exports.ElasticPool = require('./elasticPool'); exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); +exports.InstanceFailoverGroupReadWriteEndpoint = require('./instanceFailoverGroupReadWriteEndpoint'); +exports.InstanceFailoverGroupReadOnlyEndpoint = require('./instanceFailoverGroupReadOnlyEndpoint'); +exports.PartnerRegionInfo = require('./partnerRegionInfo'); +exports.ManagedInstancePairInfo = require('./managedInstancePairInfo'); +exports.InstanceFailoverGroup = require('./instanceFailoverGroup'); +exports.ShortTermRetentionPolicy = require('./shortTermRetentionPolicy'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); exports.ServerListResult = require('./serverListResult'); @@ -144,6 +155,7 @@ exports.ServerUsageListResult = require('./serverUsageListResult'); exports.DatabaseUsageListResult = require('./databaseUsageListResult'); exports.EncryptionProtectorListResult = require('./encryptionProtectorListResult'); exports.FailoverGroupListResult = require('./failoverGroupListResult'); +exports.ManagedInstanceListResult = require('./managedInstanceListResult'); exports.OperationListResult = require('./operationListResult'); exports.ServerKeyListResult = require('./serverKeyListResult'); exports.SyncAgentListResult = require('./syncAgentListResult'); @@ -156,7 +168,9 @@ exports.SyncMemberListResult = require('./syncMemberListResult'); exports.SubscriptionUsageListResult = require('./subscriptionUsageListResult'); exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); exports.LongTermRetentionBackupListResult = require('./longTermRetentionBackupListResult'); +exports.ManagedDatabaseListResult = require('./managedDatabaseListResult'); exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); +exports.InstanceFailoverGroupListResult = require('./instanceFailoverGroupListResult'); diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js new file mode 100644 index 0000000000..e9922cbba8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js @@ -0,0 +1,158 @@ +/* + * 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'); + +/** + * An instance failover group. + * + * @extends models['ProxyResource'] + */ +class InstanceFailoverGroup extends models['ProxyResource'] { + /** + * Create a InstanceFailoverGroup. + * @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} partnerRegions Partner region information for the failover + * group. + * @member {array} managedInstancePairs List of managed instance pairs in the + * failover group. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InstanceFailoverGroup + * + * @returns {object} metadata of InstanceFailoverGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroup', + type: { + name: 'Composite', + className: 'InstanceFailoverGroup', + 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' + } + }, + readWriteEndpoint: { + required: true, + serializedName: 'properties.readWriteEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadWriteEndpoint' + } + }, + readOnlyEndpoint: { + required: false, + serializedName: 'properties.readOnlyEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadOnlyEndpoint' + } + }, + replicationRole: { + required: false, + readOnly: true, + serializedName: 'properties.replicationRole', + type: { + name: 'String' + } + }, + replicationState: { + required: false, + readOnly: true, + serializedName: 'properties.replicationState', + type: { + name: 'String' + } + }, + partnerRegions: { + required: true, + serializedName: 'properties.partnerRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PartnerRegionInfoElementType', + type: { + name: 'Composite', + className: 'PartnerRegionInfo' + } + } + } + }, + managedInstancePairs: { + required: true, + serializedName: 'properties.managedInstancePairs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstancePairInfoElementType', + type: { + name: 'Composite', + className: 'ManagedInstancePairInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroup; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js new file mode 100644 index 0000000000..48f17c2c73 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.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 instance failover groups. + */ +class InstanceFailoverGroupListResult extends Array { + /** + * Create a InstanceFailoverGroupListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InstanceFailoverGroupListResult + * + * @returns {object} metadata of InstanceFailoverGroupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupListResult', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceFailoverGroupElementType', + type: { + name: 'Composite', + className: 'InstanceFailoverGroup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupListResult; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js new file mode 100644 index 0000000000..a1ddd1b8a8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js @@ -0,0 +1,54 @@ +/* + * 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'; + +/** + * Read-only endpoint of the failover group instance. + * + */ +class InstanceFailoverGroupReadOnlyEndpoint { + /** + * Create a InstanceFailoverGroupReadOnlyEndpoint. + * @member {string} [failoverPolicy] Failover policy of the read-only + * endpoint for the failover group. Possible values include: 'Disabled', + * 'Enabled' + */ + constructor() { + } + + /** + * Defines the metadata of InstanceFailoverGroupReadOnlyEndpoint + * + * @returns {object} metadata of InstanceFailoverGroupReadOnlyEndpoint + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupReadOnlyEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadOnlyEndpoint', + modelProperties: { + failoverPolicy: { + required: false, + serializedName: 'failoverPolicy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupReadOnlyEndpoint; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js new file mode 100644 index 0000000000..860c661d76 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js @@ -0,0 +1,66 @@ +/* + * 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'; + +/** + * Read-write endpoint of the failover group instance. + * + */ +class InstanceFailoverGroupReadWriteEndpoint { + /** + * Create a InstanceFailoverGroupReadWriteEndpoint. + * @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. + */ + constructor() { + } + + /** + * Defines the metadata of InstanceFailoverGroupReadWriteEndpoint + * + * @returns {object} metadata of InstanceFailoverGroupReadWriteEndpoint + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupReadWriteEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadWriteEndpoint', + modelProperties: { + failoverPolicy: { + required: true, + serializedName: 'failoverPolicy', + type: { + name: 'String' + } + }, + failoverWithDataLossGracePeriodMinutes: { + required: false, + serializedName: 'failoverWithDataLossGracePeriodMinutes', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupReadWriteEndpoint; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabase.js b/lib/services/sqlManagement2/lib/models/managedDatabase.js new file mode 100644 index 0000000000..42e4dcefc4 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabase.js @@ -0,0 +1,213 @@ +/* + * 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 managed database resource. + * + * @extends models['TrackedResource'] + */ +class ManagedDatabase extends models['TrackedResource'] { + /** + * Create a ManagedDatabase. + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values + * include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create + * the new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup + * of an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedDatabase + * + * @returns {object} metadata of ManagedDatabase + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabase', + type: { + name: 'Composite', + className: 'ManagedDatabase', + 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' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + collation: { + required: false, + serializedName: 'properties.collation', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + earliestRestorePoint: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestorePoint', + type: { + name: 'DateTime' + } + }, + restorePointInTime: { + required: false, + serializedName: 'properties.restorePointInTime', + type: { + name: 'DateTime' + } + }, + defaultSecondaryLocation: { + required: false, + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', + type: { + name: 'String' + } + }, + catalogCollation: { + required: false, + serializedName: 'properties.catalogCollation', + type: { + name: 'String' + } + }, + createMode: { + required: false, + serializedName: 'properties.createMode', + type: { + name: 'String' + } + }, + storageContainerUri: { + required: false, + serializedName: 'properties.storageContainerUri', + type: { + name: 'String' + } + }, + sourceDatabaseId: { + required: false, + serializedName: 'properties.sourceDatabaseId', + type: { + name: 'String' + } + }, + storageContainerSasToken: { + required: false, + serializedName: 'properties.storageContainerSasToken', + type: { + name: 'String' + } + }, + failoverGroupId: { + required: false, + readOnly: true, + serializedName: 'properties.failoverGroupId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedDatabase; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js b/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js new file mode 100644 index 0000000000..dcd44d94b3 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.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 managed databases. + */ +class ManagedDatabaseListResult extends Array { + /** + * Create a ManagedDatabaseListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedDatabaseListResult + * + * @returns {object} metadata of ManagedDatabaseListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabaseListResult', + type: { + name: 'Composite', + className: 'ManagedDatabaseListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedDatabaseElementType', + type: { + name: 'Composite', + className: 'ManagedDatabase' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedDatabaseListResult; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js b/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js new file mode 100644 index 0000000000..8649d21350 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js @@ -0,0 +1,179 @@ +/* + * 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 managed database update. + * + */ +class ManagedDatabaseUpdate { + /** + * Create a ManagedDatabaseUpdate. + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values + * include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create + * the new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup + * of an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedDatabaseUpdate + * + * @returns {object} metadata of ManagedDatabaseUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabaseUpdate', + type: { + name: 'Composite', + className: 'ManagedDatabaseUpdate', + modelProperties: { + collation: { + required: false, + serializedName: 'properties.collation', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + earliestRestorePoint: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestorePoint', + type: { + name: 'DateTime' + } + }, + restorePointInTime: { + required: false, + serializedName: 'properties.restorePointInTime', + type: { + name: 'DateTime' + } + }, + defaultSecondaryLocation: { + required: false, + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', + type: { + name: 'String' + } + }, + catalogCollation: { + required: false, + serializedName: 'properties.catalogCollation', + type: { + name: 'String' + } + }, + createMode: { + required: false, + serializedName: 'properties.createMode', + type: { + name: 'String' + } + }, + storageContainerUri: { + required: false, + serializedName: 'properties.storageContainerUri', + type: { + name: 'String' + } + }, + sourceDatabaseId: { + required: false, + serializedName: 'properties.sourceDatabaseId', + type: { + name: 'String' + } + }, + storageContainerSasToken: { + required: false, + serializedName: 'properties.storageContainerSasToken', + type: { + name: 'String' + } + }, + failoverGroupId: { + required: false, + readOnly: true, + serializedName: 'properties.failoverGroupId', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedDatabaseUpdate; diff --git a/lib/services/sqlManagement2/lib/models/managedInstance.js b/lib/services/sqlManagement2/lib/models/managedInstance.js new file mode 100644 index 0000000000..bfef773885 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstance.js @@ -0,0 +1,198 @@ +/* + * 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'); + +/** + * An Azure SQL managed instance. + * + * @extends models['TrackedResource'] + */ +class ManagedInstance extends models['TrackedResource'] { + /** + * Create a ManagedInstance. + * @member {object} [identity] The Azure Active Directory identity of the + * managed instance. + * @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 {object} [sku] Managed instance 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} [fullyQualifiedDomainName] The fully qualified domain + * name of the managed instance. + * @member {string} [administratorLogin] Administrator username for the + * managed instance. Can only be specified when the managed instance is being + * created (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedInstance + * + * @returns {object} metadata of ManagedInstance + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstance', + type: { + name: 'Composite', + className: 'ManagedInstance', + 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' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'ResourceIdentity' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + fullyQualifiedDomainName: { + required: false, + readOnly: true, + serializedName: 'properties.fullyQualifiedDomainName', + type: { + name: 'String' + } + }, + administratorLogin: { + required: false, + serializedName: 'properties.administratorLogin', + type: { + name: 'String' + } + }, + administratorLoginPassword: { + required: false, + serializedName: 'properties.administratorLoginPassword', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vCores: { + required: false, + serializedName: 'properties.vCores', + type: { + name: 'Number' + } + }, + storageSizeInGB: { + required: false, + serializedName: 'properties.storageSizeInGB', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ManagedInstance; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceListResult.js b/lib/services/sqlManagement2/lib/models/managedInstanceListResult.js new file mode 100644 index 0000000000..a6b27f7ebf --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceListResult.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 managed instances. + */ +class ManagedInstanceListResult extends Array { + /** + * Create a ManagedInstanceListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedInstanceListResult + * + * @returns {object} metadata of ManagedInstanceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceListResult', + type: { + name: 'Composite', + className: 'ManagedInstanceListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceElementType', + type: { + name: 'Composite', + className: 'ManagedInstance' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceListResult; diff --git a/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js b/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js new file mode 100644 index 0000000000..c352f8d74c --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.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'; + +/** + * Pairs of Managed Instances in the failover group. + * + */ +class ManagedInstancePairInfo { + /** + * Create a ManagedInstancePairInfo. + * @member {string} [primaryManagedInstanceId] Id of Primary Managed Instance + * in pair. + * @member {string} [partnerManagedInstanceId] Id of Partner Managed Instance + * in pair. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstancePairInfo + * + * @returns {object} metadata of ManagedInstancePairInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstancePairInfo', + type: { + name: 'Composite', + className: 'ManagedInstancePairInfo', + modelProperties: { + primaryManagedInstanceId: { + required: false, + serializedName: 'primaryManagedInstanceId', + type: { + name: 'String' + } + }, + partnerManagedInstanceId: { + required: false, + serializedName: 'partnerManagedInstanceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstancePairInfo; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js b/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js new file mode 100644 index 0000000000..0e6ca36d12 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js @@ -0,0 +1,149 @@ +/* + * 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'); + +/** + * An update request for an Azure SQL Database managed instance. + * + */ +class ManagedInstanceUpdate { + /** + * Create a ManagedInstanceUpdate. + * @member {object} [sku] Managed instance 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} [fullyQualifiedDomainName] The fully qualified domain + * name of the managed instance. + * @member {string} [administratorLogin] Administrator username for the + * managed instance. Can only be specified when the managed instance is being + * created (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceUpdate + * + * @returns {object} metadata of ManagedInstanceUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceUpdate', + type: { + name: 'Composite', + className: 'ManagedInstanceUpdate', + modelProperties: { + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + fullyQualifiedDomainName: { + required: false, + readOnly: true, + serializedName: 'properties.fullyQualifiedDomainName', + type: { + name: 'String' + } + }, + administratorLogin: { + required: false, + serializedName: 'properties.administratorLogin', + type: { + name: 'String' + } + }, + administratorLoginPassword: { + required: false, + serializedName: 'properties.administratorLoginPassword', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vCores: { + required: false, + serializedName: 'properties.vCores', + type: { + name: 'Number' + } + }, + storageSizeInGB: { + required: false, + serializedName: 'properties.storageSizeInGB', + type: { + name: 'Number' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceUpdate; diff --git a/lib/services/sqlManagement2/lib/models/partnerRegionInfo.js b/lib/services/sqlManagement2/lib/models/partnerRegionInfo.js new file mode 100644 index 0000000000..dc0b958260 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/partnerRegionInfo.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'; + +/** + * Partner region information for the failover group. + * + */ +class PartnerRegionInfo { + /** + * Create a PartnerRegionInfo. + * @member {string} [location] Geo location of the partner managed instances. + * @member {string} [replicationRole] Replication role of the partner managed + * instances. Possible values include: 'Primary', 'Secondary' + */ + constructor() { + } + + /** + * Defines the metadata of PartnerRegionInfo + * + * @returns {object} metadata of PartnerRegionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'PartnerRegionInfo', + type: { + name: 'Composite', + className: 'PartnerRegionInfo', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + replicationRole: { + required: false, + readOnly: true, + serializedName: 'replicationRole', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartnerRegionInfo; diff --git a/lib/services/sqlManagement2/lib/models/shortTermRetentionPolicy.js b/lib/services/sqlManagement2/lib/models/shortTermRetentionPolicy.js new file mode 100644 index 0000000000..10bf5396d9 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/shortTermRetentionPolicy.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 short term retention policy resource. + * + * @extends models['ProxyResource'] + */ +class ShortTermRetentionPolicy extends models['ProxyResource'] { + /** + * Create a ShortTermRetentionPolicy. + * @member {number} [retentionDays] The backup retention period in days. This + * is how many days Point-in-Time Restore will be supported. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ShortTermRetentionPolicy + * + * @returns {object} metadata of ShortTermRetentionPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'ShortTermRetentionPolicy', + type: { + name: 'Composite', + className: 'ShortTermRetentionPolicy', + 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' + } + }, + retentionDays: { + required: false, + serializedName: 'properties.retentionDays', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ShortTermRetentionPolicy; diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index c753734bba..bbd70b7886 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -10710,15 +10710,15 @@ export interface FailoverGroups { /** * @class - * Operations + * ManagedInstances * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface Operations { +export interface ManagedInstances { /** - * Lists all of the available SQL Rest API operations. + * Gets a list of all managed instances in the subscription. * * @param {object} [options] Optional Parameters. * @@ -10727,14 +10727,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. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of all managed instances in the subscription. * * @param {object} [options] Optional Parameters. * @@ -10748,7 +10748,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10756,23 +10756,25 @@ 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. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} 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; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of managed instances in a resource group. * - * @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 {object} [options] Optional Parameters. * @@ -10781,17 +10783,18 @@ 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>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of managed instances in a resource group. * - * @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 {object} [options] Optional Parameters. * @@ -10805,7 +10808,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10813,35 +10816,27 @@ 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. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} 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 { + 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 server keys. + * Gets a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -10850,20 +10845,20 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. + * Gets a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -10877,7 +10872,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10885,159 +10880,140 @@ 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. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} 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, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server key. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * @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' * - * @returns {Promise} A promise is returned + * @param {object} [parameters.sku] Managed instance sku * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a server key. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} resourceGroupName The name 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.size] Size of the particular SKU * - * @param {string} serverName The name of the server. + * @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} keyName The name of the server key to be retrieved. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @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. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * {Promise} A promise is returned. + * @param {number} [parameters.vCores] The number of VCores. * - * @resolve {ServerKey} - The deserialized result object. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.tags] Resource tags. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} parameters.location Resource location. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options] Optional Parameters. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @returns {Promise} A promise is returned * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. */ - 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; - + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} 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} managedInstanceName The name of the managed instance. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {object} parameters The requested managed instance resource state. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * @param {date} [parameters.creationDate] The server key creation date. + * @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 {object} [options] Optional Parameters. + * @param {object} [parameters.sku] Managed instance 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. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a server key. + * @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} resourceGroupName The 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.sku.capacity] Capacity of the particular SKU. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @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} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {object} parameters The requested server key resource state. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {number} [parameters.vCores] The number of VCores. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {object} [parameters.tags] Resource tags. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11051,7 +11027,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11059,28 +11035,26 @@ 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. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} 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, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} keyName The name of the server key to be deleted. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11093,18 +11067,16 @@ 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, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} keyName The name of the server key to be deleted. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11132,41 +11104,55 @@ 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, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * - * @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 managed instance resource state. * - * @param {object} parameters The requested server key resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11175,42 +11161,56 @@ 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, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} 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} managedInstanceName The name of the managed instance. * - * @param {object} parameters The requested server key resource state. + * @param {object} parameters The requested managed instance resource state. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {date} [parameters.creationDate] The server key creation date. + * @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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11224,7 +11224,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11232,28 +11232,72 @@ 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. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} 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, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * - * @param {string} keyName The name of the server key to be deleted. + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11262,78 +11306,66 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} keyName The name of the server key to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} managedInstanceName The name of the managed instance. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters The requested managed instance resource state. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * {Promise} A promise is returned. + * @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' * - * @resolve {null} - The deserialized result object. + * @param {object} [parameters.sku] Managed instance sku * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {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; - - - /** - * Gets a list of server keys. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * @returns {Promise} A promise is returned + * @param {number} [parameters.vCores] The number of VCores. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @reject {Error|ServiceError} - The error object. - */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of server keys. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11347,7 +11379,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11355,38 +11387,26 @@ 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. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} 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 { + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync agent. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains 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 {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11395,23 +11415,20 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync agent. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains 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 {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11425,7 +11442,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. * @@ -11433,34 +11450,61 @@ 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; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains 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} managedInstanceName The name of the managed instance. * - * @param {string} syncAgentName The name of the sync agent. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} parameters The requested sync agent resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11469,28 +11513,56 @@ 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>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains 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} managedInstanceName The name of the managed instance. * - * @param {string} syncAgentName The name of the sync agent. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} parameters The requested sync agent resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11504,7 +11576,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11512,29 +11584,23 @@ 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. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} 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; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * 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 a list of all managed instances in the subscription. * - * @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. * @@ -11543,23 +11609,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Gets a list of all managed instances in the subscription. * - * @param {string} resourceGroupName The name of the resource group that - * contains 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 {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11573,7 +11633,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11581,26 +11641,24 @@ 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. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} 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, 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; + 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; /** - * 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. + * Gets a list of managed instances in a resource group. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11609,21 +11667,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of managed instances in a resource group. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11637,7 +11691,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11645,29 +11699,30 @@ 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. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} 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; + 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 + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Operations { /** - * 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 on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -11676,23 +11731,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. */ - generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -11706,7 +11752,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentKeyProperties} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11714,30 +11760,23 @@ 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. + * {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. */ - 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; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(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 all of the available SQL Rest API operations. * - * @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. * @@ -11746,23 +11785,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>; + listNextWithHttpOperationResponse(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 all of the available SQL Rest API operations. * - * @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. * @@ -11776,7 +11809,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11784,35 +11817,35 @@ 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. + * {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. */ - 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; + 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 { /** - * Creates or updates a sync agent. + * 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. * - * @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. - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -11821,28 +11854,20 @@ 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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * 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. * - * @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. - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -11856,7 +11881,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11864,29 +11889,28 @@ 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. + * {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. */ - 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; + 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 a sync agent. + * 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 * 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} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -11895,23 +11919,22 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * 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 * 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} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -11925,7 +11948,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11933,22 +11956,48 @@ 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. + * {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. */ - 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; + 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; /** - * Lists sync agents in a server. + * Creates or updates a server key. * - * @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} 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. * @@ -11957,31 +12006,56 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Creates or updates a server key. * - * @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 {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters The requested server key resource state. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * {Promise} A promise is returned. + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @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 + * 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 {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11989,23 +12063,28 @@ 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. + * {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. */ - 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; + 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; /** - * Lists databases linked to a sync agent. + * Deletes the server key with the given name. * - * @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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12014,17 +12093,22 @@ 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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Deletes the server key with the given name. * - * @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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12038,7 +12122,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12046,33 +12130,47 @@ 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. + * {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. */ - 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 { + 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; /** - * Gets a collection of sync database ids. + * Creates or updates a server key. * - * @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} 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. * @@ -12081,17 +12179,42 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Creates or updates a server key. * - * @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} 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. * @@ -12105,7 +12228,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12113,21 +12236,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. + * {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. */ - 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; + 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; /** - * Refreshes a hub database schema. + * 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 @@ -12135,10 +12257,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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12151,10 +12270,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * 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 @@ -12162,10 +12281,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} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12193,24 +12309,16 @@ export interface SyncGroups { * * {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; + 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 collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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 server keys. * - * @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. * @@ -12219,25 +12327,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. */ - listHubSchemasWithHttpOperationResponse(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 collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the 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 server keys. * - * @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. * @@ -12251,7 +12351,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12259,82 +12359,66 @@ 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. + * {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. */ - 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; + 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 { /** - * Gets a collection of sync group logs. + * 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} 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} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} syncAgentName The name of the sync agent. * * @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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * 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} 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} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} syncAgentName The name of the sync agent. * * @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 * @@ -12345,7 +12429,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12353,32 +12437,34 @@ 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 - * 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. */ - 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; + 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; /** - * Cancels a sync group synchronization. + * 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 on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} syncGroupName The name of the sync group. + * @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. * @@ -12387,25 +12473,28 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels a sync group synchronization. + * 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 on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} syncGroupName The name of the sync group. + * @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. * @@ -12419,7 +12508,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12427,30 +12516,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. + * {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. */ - 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; + 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; /** - * Triggers a sync group synchronization. + * 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 on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12463,21 +12551,19 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Triggers a sync group synchronization. + * 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 on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12505,24 +12591,20 @@ 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; + 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; /** - * Gets a sync group. + * 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 on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -12531,25 +12613,21 @@ 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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync group. + * 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 on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -12563,7 +12641,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12571,55 +12649,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. + * {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. */ - 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; + 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 group. + * 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} 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} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12628,49 +12680,23 @@ 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>; + generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. + * 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} 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} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12684,7 +12710,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentKeyProperties} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12692,31 +12718,30 @@ 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. + * {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. */ - 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; + 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; /** - * Deletes a sync group. + * 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} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12725,25 +12750,23 @@ 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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * 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} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12757,7 +12780,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12765,54 +12788,35 @@ 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. + * {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. */ - 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; + 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; /** - * Updates a sync group. + * 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} 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 {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @param {object} parameters The requested sync agent resource state. * * @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. + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12821,49 +12825,28 @@ 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. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. + * 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} 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 {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @param {object} parameters The requested sync agent resource state. * * @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. + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12877,7 +12860,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12885,29 +12868,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. + * {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. */ - 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; + 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; /** - * Lists sync groups under a hub database. + * 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 on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12916,23 +12899,23 @@ 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. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * 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 on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12946,7 +12929,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12954,31 +12937,22 @@ 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. + * {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; + 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; /** - * 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. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Lists sync agents 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. * @@ -12987,25 +12961,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. */ - beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Lists sync agents 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. * @@ -13019,7 +12985,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13027,54 +12993,23 @@ 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. + * {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. */ - 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; + 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; /** - * 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. - * - * @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 databases linked to a sync agent. * - * @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. * @@ -13083,49 +13018,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: 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' - * - * @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 databases linked to a sync agent. * - * @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. * @@ -13139,7 +13042,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13147,20 +13050,88 @@ 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. + * {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. */ - 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; - + 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; +} - /** - * Deletes a sync group. +/** + * @class + * SyncGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncGroups { + + + /** + * Gets a collection of sync database ids. + * + * @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|ServiceError} - The error object. + */ + listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync database ids. + * + * @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 {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 {SyncDatabaseIdListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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 @@ -13184,10 +13155,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync 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 @@ -13226,13 +13197,13 @@ export interface SyncGroups { * * {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; + 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; /** - * Updates a sync group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13245,30 +13216,6 @@ export interface SyncGroups { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13276,14 +13223,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. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13296,30 +13243,6 @@ export interface SyncGroups { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13332,7 +13255,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13340,45 +13263,82 @@ 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. + * {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. */ - 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; + 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 collection of sync database ids. + * Gets a collection of sync group logs. * - * @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 {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. */ - listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: 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 collection of sync database ids. + * Gets a collection of sync group logs. * - * @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 {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 * @@ -13389,7 +13349,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13397,24 +13357,32 @@ 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 + * {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. */ - 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; + 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; /** - * Gets a collection of hub database schemas. + * Cancels a sync group synchronization. * - * @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. * @@ -13423,17 +13391,25 @@ 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>; + cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Cancels a sync group synchronization. * - * @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. * @@ -13447,7 +13423,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. * @@ -13455,101 +13431,57 @@ 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. */ - 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; + 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; /** - * Gets a collection of sync group logs. - * - * @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 + * Triggers a sync group synchronization. * - * @returns {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 {HttpOperationResponse} - The deserialized result object. + * @param {string} serverName The name of the server. * - * @reject {Error|ServiceError} - The error object. - */ - listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a collection of sync group logs. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} syncGroupName The name of the sync group. * * @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 {SyncGroupLogListResult} - 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. - * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} 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. */ - 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; - + triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub 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 + * Triggers a sync group synchronization. * - * @returns {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 {HttpOperationResponse} - The deserialized result object. + * @param {string} serverName The name of the server. * - * @reject {Error|ServiceError} - The error object. - */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists sync groups under a hub database. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13563,7 +13495,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13571,29 +13503,19 @@ 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. + * {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. */ - 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 { + 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; /** - * Gets a sync member. + * 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 @@ -13604,10 +13526,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13616,14 +13535,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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member. + * 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 @@ -13634,10 +13553,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13651,7 +13567,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13659,20 +13575,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. + * {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. */ - 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; + 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; /** - * Creates or updates a sync member. + * 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 @@ -13683,37 +13599,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13722,14 +13632,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * 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 @@ -13740,37 +13650,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13784,7 +13688,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13792,20 +13696,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. + * {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. */ - 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; + 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; /** - * Deletes a sync member. + * 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 @@ -13816,10 +13720,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13832,10 +13733,10 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * 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 @@ -13846,10 +13747,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13877,13 +13775,13 @@ export interface SyncMembers { * * {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; + 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; /** - * Updates an existing sync member. + * 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 @@ -13894,37 +13792,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13933,14 +13825,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. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * 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 @@ -13951,37 +13843,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13995,7 +13881,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14003,20 +13889,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. + * {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, 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; + 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; /** - * Lists sync members in the given sync 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 @@ -14027,8 +13913,6 @@ export interface SyncMembers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14036,14 +13920,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. */ - listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync 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 @@ -14054,8 +13938,6 @@ export interface SyncMembers { * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14068,7 +13950,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14076,20 +13958,20 @@ 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. + * {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. */ - 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; + 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 database schema. + * 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 @@ -14100,10 +13982,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14112,14 +13991,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. */ - listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * 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 @@ -14130,10 +14009,7 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14147,7 +14023,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. * @@ -14155,21 +14031,19 @@ 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; + 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; /** - * Refreshes a sync member database schema. + * 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 @@ -14180,10 +14054,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. + * @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. * @@ -14192,14 +14087,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. */ - refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * 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 @@ -14210,10 +14105,31 @@ export interface SyncMembers { * @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} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. + * @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. * @@ -14227,7 +14143,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14235,19 +14151,20 @@ 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. + * {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. */ - 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; + 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; /** - * Creates or updates a sync member. + * 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 @@ -14258,37 +14175,7 @@ export interface SyncMembers { * @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 {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14297,14 +14184,2979 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * 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. + * + * @param {string} syncGroupName The name of the sync group. + * + * @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. + */ + 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; + + + /** + * 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. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. + * + * @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, syncGroupName: string, parameters: models.SyncGroup, 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. + * + * @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. + * + * @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 {SyncGroup} - 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. + * + * {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, 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; + + + /** + * Gets a collection of sync database ids. + * + * @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|ServiceError} - The error object. + */ + listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync database ids. + * + * @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 {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 {SyncDatabaseIdListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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. + * + * @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. + */ + listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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 {SyncFullSchemaPropertiesListResult} - 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. + * + * {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. + */ + 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; + + + /** + * Gets a collection of sync group logs. + * + * @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|ServiceError} - The error object. + */ + listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync group logs. + * + * @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 {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 {SyncGroupLogListResult} - 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. + * + * {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. + */ + 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; + + + /** + * Lists sync groups under a hub 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|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists sync groups under a hub 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 {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 {SyncGroupListResult} - 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. + * + * {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. + */ + 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 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} [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, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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. + * + * @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 {SyncMember} - 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. + * + * {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, 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 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} [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 + * 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, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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} [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 + * 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 {SyncMember} - 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. + * + * {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, 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 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} [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, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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. + * + * @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, 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; + + + /** + * 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. + * + * @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 + * 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, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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 + * 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 {SyncMember} - 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. + * + * {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. + */ + 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; + + + /** + * 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 + * 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. + * + * @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. + */ + listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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. + * + * @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 {SyncMemberListResult} - 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. + * + * {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. + */ + 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 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. + * + * @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. + * + * @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. + */ + listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets 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. + * + * @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. + * + * @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 {SyncFullSchemaPropertiesListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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. + * + * @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. + * + * @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. + */ + refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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. + * + * @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. + */ + 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 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} [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 + * 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, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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} [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 + * 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 {SyncMember} - 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. + * + * {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, 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 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} [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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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. + * + * @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. + */ + 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; + + + /** + * 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. + * + * @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 + * 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, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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 + * 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 {SyncMember} - 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. + * + * {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. + */ + 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; + + + /** + * 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. + * + * @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. + * + * @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. + */ + beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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. + * + * @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. + * + * @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. + */ + 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 sync members in the given sync group. + * + * @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|ServiceError} - The error object. + */ + listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists sync members in the given sync group. + * + * @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 {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 {SyncMemberListResult} - 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. + * + * {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. + */ + 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; + + + /** + * Gets a sync member database schema. + * + * @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|ServiceError} - The error object. + */ + listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a sync member database schema. + * + * @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 {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 {SyncFullSchemaPropertiesListResult} - 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. + * + * {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. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SubscriptionUsageListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SubscriptionUsage} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SubscriptionUsageListResult} - 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. + * + * {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. + */ + 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 + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface VirtualNetworkRules { + + + /** + * Gets a 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 + * 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. + * + * @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, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a 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 + * 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. + * + * @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 {VirtualNetworkRule} - 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. + * + * {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. + */ + 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; + + + /** + * 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 + * 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} 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. + * + * @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, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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} 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. + * + * @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 {VirtualNetworkRule} - 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. + * + * {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. + */ + 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; + + + /** + * 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 + * 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. + * + * @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, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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. + * + * @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, 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 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 + * 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>; + + /** + * 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 + * 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 {VirtualNetworkRuleListResult} - 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. + * + * {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. + */ + 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 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 + * 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} 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. + * + * @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, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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} 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. + * + * @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 {VirtualNetworkRule} - 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. + * + * {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. + */ + 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; + + + /** + * 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 + * 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. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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. + * + * @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. + */ + 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 list of virtual network rules 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual network rules 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 {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 {VirtualNetworkRuleListResult} - 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. + * + * {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. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackup} - 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. + * + * {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. + */ + 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 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|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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(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; + + + /** + * 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|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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(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 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|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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. + */ + 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {LongTermRetentionBackupListResult} - 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. + * + * {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. + */ + 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 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 + * + * @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 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 {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 {BackupLongTermRetentionPolicy} - 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. + * + * {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, 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; + + + /** + * 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 @@ -14312,40 +17164,59 @@ 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 {object} parameters The requested sync member resource state. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets a database's long term retention policy. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} resourceGroupName The name of the resource group that + * contains the 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. * @@ -14359,7 +17230,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. * @@ -14367,20 +17238,21 @@ 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. */ - 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; + 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; /** - * Deletes a sync member. + * 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 @@ -14388,13 +17260,7 @@ 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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14403,14 +17269,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * 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 @@ -14418,13 +17284,7 @@ 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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14438,7 +17298,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14446,19 +17306,21 @@ 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. + * {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. */ - 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; + 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; /** - * Updates an existing 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 @@ -14466,40 +17328,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} 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} databaseName The name of the database. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {object} parameters The long term retention policy info. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -14508,14 +17351,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. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing 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 @@ -14523,40 +17366,104 @@ 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} [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. + * + * @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 {BackupLongTermRetentionPolicy} - 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. + * + * {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. + */ + 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 + * ManagedDatabases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ManagedDatabases { + + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} syncMemberName The name of the sync member. + * @param {object} parameters The definition for completing the restore of this + * managed database. * - * @param {object} parameters The requested sync member resource state. + * @param {string} parameters.lastBackupName The last backup name to apply * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @reject {Error|ServiceError} - The error object. + */ + completeRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Completes the restore operation on a managed database. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -14570,7 +17477,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. * @@ -14578,34 +17485,25 @@ 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; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Gets a list of managed databases. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -14614,28 +17512,20 @@ 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. */ - beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByInstanceWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Gets a list of managed databases. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -14649,7 +17539,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14657,22 +17547,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. + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} 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. */ - 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; + listByInstance(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstance(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + listByInstance(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync members in the given sync group. + * Gets a managed database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14681,17 +17578,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. */ - listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Gets a managed database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14705,7 +17607,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14713,23 +17615,64 @@ 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. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member database schema. + * Creates a new database or updates an existing database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -14738,17 +17681,58 @@ 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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Creates a new database or updates an existing database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -14762,7 +17746,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14770,33 +17754,28 @@ 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. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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 - * SubscriptionUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SubscriptionUsages { + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all subscription usage metrics in a given location. + * Deletes the managed database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14805,17 +17784,22 @@ export interface SubscriptionUsages { * * @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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subscription usage metrics in a given location. + * Deletes the managed database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14829,7 +17813,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14837,26 +17821,61 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsageListResult} 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. */ - 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; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a subscription usage metric. + * Updates an existing database. * - * @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} usageName Name of usage metric to return. + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14865,19 +17884,56 @@ export interface SubscriptionUsages { * * @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(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a subscription usage metric. + * Updates an existing database. * - * @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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} usageName Name of usage metric to return. + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -14891,7 +17947,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsage} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14899,23 +17955,31 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsage} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsage} for more information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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(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; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all subscription usage metrics in a given location. + * Completes the restore operation on a managed database. * - * @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 {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -14924,17 +17988,25 @@ export interface SubscriptionUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCompleteRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subscription usage metrics in a given location. + * Completes the restore operation on a managed database. * - * @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 {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -14948,7 +18020,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14956,38 +18028,63 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsageListResult} 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. */ - 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 - * VirtualNetworkRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface VirtualNetworkRules { + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a virtual network 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 * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -14996,22 +18093,58 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual network 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 * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -15025,7 +18158,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15033,37 +18166,28 @@ 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. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an existing virtual network rule. + * Deletes the managed 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} 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} managedInstanceName The name of the managed instance. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15072,31 +18196,22 @@ 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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Deletes the managed 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} 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} managedInstanceName The name of the managed instance. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15110,7 +18225,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. * @@ -15118,28 +18233,61 @@ 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. */ - 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; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * 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} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15148,22 +18296,56 @@ 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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * 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} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15177,7 +18359,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15185,25 +18367,23 @@ 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. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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, 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; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * 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 - * Manager API or the portal. + * Gets a list of managed databases. * - * @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. * @@ -15212,20 +18392,17 @@ 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>; + listByInstanceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. + * Gets a list of managed databases. * - * @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. * @@ -15239,7 +18416,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15247,21 +18424,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 + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} 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; + listByInstanceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstanceNext(nextPageLink: string, callback: ServiceCallback): void; + listByInstanceNext(nextPageLink: string, 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 an existing virtual network rule. + * 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 @@ -15269,17 +18455,6 @@ 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 {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15287,31 +18462,20 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * 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 {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 {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -15325,7 +18489,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15333,20 +18497,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. + * {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. */ - 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; + 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 the virtual network rule with the given name. + * 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 @@ -15354,7 +18518,12 @@ 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 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. * @@ -15363,14 +18532,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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * 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 @@ -15378,7 +18547,12 @@ 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 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. * @@ -15392,7 +18566,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15400,22 +18574,38 @@ 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. + * {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. */ - 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; + 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 { /** - * Gets a list of virtual network rules in a server. + * Gets a server DNS alias. * - * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15424,17 +18614,23 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Gets a server DNS alias. * - * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15448,7 +18644,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15456,38 +18652,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. + * {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. */ - 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 { + 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; /** - * Gets a long term retention backup. - * - * @param {string} locationName The location of the database. + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15496,22 +18683,23 @@ export interface LongTermRetentionBackups { * * @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(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a long term retention backup. - * - * @param {string} locationName The location of the database. + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15525,7 +18713,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackup} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15533,29 +18721,29 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackup} 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. */ - 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; + 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; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Deletes the server DNS alias with the given name. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15568,18 +18756,19 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Deletes the server DNS alias with the given name. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15607,58 +18796,46 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * Lists all long term retention backups for a database. - * - * @param {string} locationName The location of the database + * Gets a list of server DNS aliases for a server. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. - * - * @param {string} locationName The location of the database + * Gets a list of server DNS aliases for a server. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * * @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 * @@ -15669,7 +18846,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15677,57 +18854,67 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {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. */ - 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; + 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; /** - * Lists the long term retention backups for a given location. + * Acquires server DNS alias from another server. * - * @param {string} locationName The location 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 {object} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server dns alias. * - * @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} 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Acquires server DNS alias from another server. * - * @param {string} locationName The location 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 {object} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server dns alias. * - * @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} 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 @@ -15739,7 +18926,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15747,61 +18934,55 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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. */ - 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; + 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; /** - * Lists the long term retention backups for a given server. - * - * @param {string} locationName The location of the database + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The 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} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @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] 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(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. - * - * @param {string} locationName The location of the database + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The 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} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15813,7 +18994,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15821,29 +19002,29 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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. */ - 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; + 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; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Deletes the server DNS alias with the given name. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15856,18 +19037,19 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Deletes the server DNS alias with the given name. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15895,16 +19077,27 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * Lists all long term retention backups for a database. + * Acquires server DNS alias from another server. * - * @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 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. * @@ -15913,17 +19106,28 @@ export interface LongTermRetentionBackups { * * @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>; + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. + * Acquires server DNS alias from another server. * - * @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 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. * @@ -15937,7 +19141,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15945,21 +19149,19 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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. */ - 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; + 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 the long term retention backups for a given location. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15971,14 +19173,14 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15995,7 +19197,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16003,24 +19205,38 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {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. */ - 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; + 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 { /** - * Lists the long term retention backups for a given server. + * 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. * @@ -16029,17 +19245,22 @@ export interface LongTermRetentionBackups { * * @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>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. + * 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. * @@ -16053,7 +19274,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {RestorePointListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16061,30 +19282,21 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} 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. */ - 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 { + 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 database's long term retention policy. + * 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 @@ -16092,7 +19304,13 @@ 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} 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. * @@ -16101,14 +19319,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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: 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 database's long term retention policy. + * 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 @@ -16118,6 +19336,12 @@ export interface BackupLongTermRetentionPolicies { * * @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 @@ -16130,7 +19354,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16138,21 +19362,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. + * {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, 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; + 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; /** - * Sets a database's long term retention policy. + * 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 @@ -16162,19 +19385,7 @@ export interface BackupLongTermRetentionPolicies { * * @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 {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16183,14 +19394,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. + * 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 @@ -16200,19 +19411,7 @@ export interface BackupLongTermRetentionPolicies { * * @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 {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16226,7 +19425,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16234,21 +19433,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. + * {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, 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; + 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; /** - * Gets a database's long term retention policy. + * 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 @@ -16258,6 +19456,8 @@ export interface BackupLongTermRetentionPolicies { * * @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 @@ -16265,14 +19465,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. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's long term retention policy. + * 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 @@ -16282,6 +19482,8 @@ export interface BackupLongTermRetentionPolicies { * * @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 @@ -16294,7 +19496,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16302,21 +19504,19 @@ 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. + * {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; + 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; /** - * Sets a database's long term retention policy. + * 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 @@ -16326,19 +19526,11 @@ export interface BackupLongTermRetentionPolicies { * * @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 {object} parameters The definition for creating the restore point of + * this database. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16347,14 +19539,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>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. + * 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 @@ -16364,19 +19556,11 @@ export interface BackupLongTermRetentionPolicies { * * @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 {object} parameters The definition for creating the restore point of + * this database. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16390,7 +19574,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16398,30 +19582,29 @@ 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. + * {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. */ - 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; + 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 - * ServerAutomaticTuningOperations + * DatabaseOperations * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ServerAutomaticTuningOperations { +export interface DatabaseOperations { /** - * Retrieves server automatic tuning options. + * 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 @@ -16429,6 +19612,10 @@ export interface ServerAutomaticTuningOperations { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {uuid} operationId The operation identifier. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16436,14 +19623,14 @@ export interface ServerAutomaticTuningOperations { * * @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>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves server automatic tuning options. + * 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 @@ -16451,6 +19638,10 @@ export interface ServerAutomaticTuningOperations { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {uuid} operationId The operation identifier. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16463,7 +19654,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16471,20 +19662,19 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} 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; + 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; /** - * Update automatic tuning options on server. + * 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 @@ -16492,12 +19682,7 @@ export interface ServerAutomaticTuningOperations { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16506,14 +19691,14 @@ export interface ServerAutomaticTuningOperations { * * @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.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update automatic tuning options on server. + * 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 @@ -16521,12 +19706,7 @@ export interface ServerAutomaticTuningOperations { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16540,7 +19720,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16548,38 +19728,24 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} for more information. + * {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. */ - 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 { + 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 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. + * Gets a list of operations performed on the database. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16588,23 +19754,17 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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. + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of operations performed on the database. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16618,7 +19778,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16626,29 +19786,40 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {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. */ - 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; + 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 + * ElasticPoolOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolOperations { /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -16657,23 +19828,24 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -16687,7 +19859,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16695,29 +19867,27 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} 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, 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; + 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; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -16726,23 +19896,22 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -16756,7 +19925,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16764,26 +19933,24 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 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. + * Gets a list of operations performed on the elastic pool. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16792,21 +19959,17 @@ export interface ServerDnsAliases { * * @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>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of operations performed on the elastic pool. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16820,7 +19983,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16828,68 +19991,65 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} 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. */ - 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; + 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 + * Capabilities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Capabilities { /** - * 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 + * Gets the subscription capabilities available for the specified location. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 + * Gets the subscription capabilities available for the specified location. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @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 * @@ -16900,7 +20060,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LocationCapabilities} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16908,28 +20068,38 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; +} + +/** + * @class + * InstanceFailoverGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface InstanceFailoverGroups { /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -16938,23 +20108,23 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -16968,7 +20138,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16976,29 +20146,58 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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, 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; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17007,23 +20206,52 @@ export interface ServerDnsAliases { * * @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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17037,7 +20265,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17045,33 +20273,29 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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, 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; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Acquires server DNS alias from another 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 that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server dns alias. - * - * @param {object} parameters + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17084,24 +20308,19 @@ export interface ServerDnsAliases { * * @reject {Error|ServiceError} - The error object. */ - beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another 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 that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server dns alias. - * - * @param {object} parameters + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17129,16 +20348,20 @@ export interface ServerDnsAliases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server DNS aliases for a server. + * Lists the failover groups in a location. * - * @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} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -17147,17 +20370,21 @@ export interface ServerDnsAliases { * * @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>; + listByLocationWithHttpOperationResponse(resourceGroupName: string, locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server DNS aliases for a server. + * Lists the failover groups in a location. * - * @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} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -17171,7 +20398,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17179,38 +20406,31 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} for more + * {InstanceFailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} 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 - * RestorePoints - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorePoints { + listByLocation(resourceGroupName: string, locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(resourceGroupName: string, locationName: string, callback: ServiceCallback): void; + listByLocation(resourceGroupName: string, locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database restore points. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17219,22 +20439,24 @@ 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>; + failoverWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database restore points. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17248,7 +20470,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePointListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17256,35 +20478,30 @@ 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. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a restore point for a data warehouse. + * Fails over from the current primary managed instance to this managed + * instance. 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 {string} databaseName The name of the database. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17293,28 +20510,24 @@ 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. */ - createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a restore point for a data warehouse. + * Fails over from the current primary managed instance to this managed + * instance. 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 {string} databaseName The name of the database. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17328,7 +20541,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17336,30 +20549,58 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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. */ - 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; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a restore point. + * 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} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} restorePointName The name of the restore point. + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17368,24 +20609,52 @@ 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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a restore point. + * 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} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} restorePointName The name of the restore point. + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17399,7 +20668,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17407,30 +20676,29 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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, 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; + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a restore point. + * 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} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} restorePointName The name of the restore point. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17443,20 +20711,19 @@ export interface RestorePoints { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a restore point. + * 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} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} restorePointName The name of the restore point. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17484,27 +20751,23 @@ export interface RestorePoints { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a restore point for a data warehouse. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17513,28 +20776,24 @@ 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. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a restore point for a data warehouse. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the 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} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17548,7 +20807,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17556,39 +20815,30 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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. */ - 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 { + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels the asynchronous operation on the database. + * Fails over from the current primary managed instance to this managed + * instance. 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 {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17597,24 +20847,24 @@ 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. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * Fails over from the current primary managed instance to this managed + * instance. 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 {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17628,7 +20878,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17636,27 +20886,23 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} 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. */ - 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; + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Lists the failover groups in a location. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17665,22 +20911,17 @@ 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>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Lists the failover groups in a location. * - * @param {string} databaseName The name of the database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -17694,7 +20935,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17702,24 +20943,38 @@ 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 + * {InstanceFailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} 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; + 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 + * ShortTermRetentionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ShortTermRetentionPolicies { /** - * Gets a list of operations performed on the database. + * Gets a database's short 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. * @@ -17728,17 +20983,22 @@ 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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a database's short 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. * @@ -17752,7 +21012,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {ShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17760,30 +21020,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 + * {ShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ShortTermRetentionPolicy} 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 - * ElasticPoolOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolOperations { + 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; /** - * Cancels the asynchronous operation on the elastic pool. + * Updates a database's short 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 @@ -17791,9 +21042,12 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17802,14 +21056,14 @@ export interface ElasticPoolOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the elastic pool. + * Updates a database's short 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 @@ -17817,9 +21071,12 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. * - * @param {uuid} operationId The operation identifier. + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17833,7 +21090,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17841,19 +21098,21 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ShortTermRetentionPolicy} 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. */ - 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; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the elastic pool. + * Updates a database's short 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 @@ -17861,7 +21120,12 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17870,14 +21134,14 @@ export interface ElasticPoolOperations { * * @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>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * Updates a database's short 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 @@ -17885,7 +21149,12 @@ export interface ElasticPoolOperations { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17899,7 +21168,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {ShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17907,24 +21176,34 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} for more + * {ShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ShortTermRetentionPolicy} 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; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the elastic pool. + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17933,17 +21212,27 @@ export interface ElasticPoolOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. * * @param {object} [options] Optional Parameters. * @@ -17957,7 +21246,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {ShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17965,64 +21254,65 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} for more + * {ShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ShortTermRetentionPolicy} 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. */ - 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 - * Capabilities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Capabilities { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the subscription capabilities available for the specified location. + * Updates a database's short term retention policy. * - * @param {string} locationName The location name 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 {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {string} [options.include] If specified, restricts the response to - * only include the selected item. Possible values include: - * 'supportedEditions', 'supportedElasticPoolEditions', - * 'supportedManagedInstanceVersions' + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the subscription capabilities available for the specified location. + * Updates a database's short term retention policy. * - * @param {string} locationName The location name 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 {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {string} [options.include] If specified, restricts the response to - * only include the selected item. Possible values include: - * 'supportedEditions', 'supportedElasticPoolEditions', - * 'supportedManagedInstanceVersions' + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18034,7 +21324,7 @@ export interface Capabilities { * * {Promise} A promise is returned. * - * @resolve {LocationCapabilities} - The deserialized result object. + * @resolve {ShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18042,14 +21332,15 @@ 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. + * {ShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ShortTermRetentionPolicy} 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; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ShortTermRetentionPolicy, 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 56d738959a..216e19d49f 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -41,6 +41,7 @@ exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies') exports.DatabaseAutomaticTuningOperations = require('./databaseAutomaticTuningOperations'); exports.EncryptionProtectors = require('./encryptionProtectors'); exports.FailoverGroups = require('./failoverGroups'); +exports.ManagedInstances = require('./managedInstances'); exports.Operations = require('./operations'); exports.ServerKeys = require('./serverKeys'); exports.SyncAgents = require('./syncAgents'); @@ -50,9 +51,12 @@ exports.SubscriptionUsages = require('./subscriptionUsages'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); exports.LongTermRetentionBackups = require('./longTermRetentionBackups'); exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); +exports.ManagedDatabases = require('./managedDatabases'); exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); exports.ServerDnsAliases = require('./serverDnsAliases'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); exports.Capabilities = require('./capabilities'); +exports.InstanceFailoverGroups = require('./instanceFailoverGroups'); +exports.ShortTermRetentionPolicies = require('./shortTermRetentionPolicies'); diff --git a/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js b/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js new file mode 100644 index 0000000000..963a57ef7e --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js @@ -0,0 +1,2634 @@ +/* + * 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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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 (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 (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + 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['InstanceFailoverGroup']().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 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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, locationName, failoverGroupName, 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['InstanceFailoverGroup']().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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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, locationName, failoverGroupName, 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, locationName, failoverGroupName, 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 the failover groups in a 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 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 InstanceFailoverGroupListResult} 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(resourceGroupName, 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 = '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 (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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['InstanceFailoverGroupListResult']().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); + }); +} + + +/** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * 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 InstanceFailoverGroup} 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 _failover(resourceGroupName, locationName, failoverGroupName, 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.beginFailover(resourceGroupName, locationName, failoverGroupName, 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['InstanceFailoverGroup']().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); + }); + }); +} + + +/** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 InstanceFailoverGroup} 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 _forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, 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.beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, 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['InstanceFailoverGroup']().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 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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 (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 (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['InstanceFailoverGroup']().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['InstanceFailoverGroup']().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['InstanceFailoverGroup']().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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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, locationName, failoverGroupName, 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 (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 (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + 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); + }); +} + +/** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * 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 InstanceFailoverGroup} 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 _beginFailover(resourceGroupName, locationName, failoverGroupName, 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 (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 (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + 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['InstanceFailoverGroup']().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); + }); +} + +/** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 InstanceFailoverGroup} 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 _beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, 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 (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 (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + 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['InstanceFailoverGroup']().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 failover groups in a 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 InstanceFailoverGroupListResult} 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['InstanceFailoverGroupListResult']().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 InstanceFailoverGroups. */ +class InstanceFailoverGroups { + /** + * Create a InstanceFailoverGroups. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByLocation = _listByLocation; + this._failover = _failover; + this._forceFailoverAllowDataLoss = _forceFailoverAllowDataLoss; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginFailover = _beginFailover; + this._beginForceFailoverAllowDataLoss = _beginForceFailoverAllowDataLoss; + this._listByLocationNext = _listByLocationNext; + } + + /** + * 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} locationName The name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, locationName, failoverGroupName, 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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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, locationName, failoverGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, locationName, failoverGroupName, 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 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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._createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback); + } + } + + /** + * 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} locationName The name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, locationName, failoverGroupName, 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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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, locationName, failoverGroupName, 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, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Lists the failover groups in a 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 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(resourceGroupName, locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(resourceGroupName, 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 failover groups in a 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 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 {InstanceFailoverGroupListResult} - 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 InstanceFailoverGroupListResult} 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(resourceGroupName, 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(resourceGroupName, locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(resourceGroupName, locationName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + failoverWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._failover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * 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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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. + */ + failover(resourceGroupName, locationName, failoverGroupName, 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._failover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._failover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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. + */ + forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, 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._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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, locationName, failoverGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, 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 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} locationName The name of the region where the resource is + * located. + * + * @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.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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, locationName, failoverGroupName, 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._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback); + } + } + + /** + * 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} locationName The name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, 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 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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, locationName, failoverGroupName, 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, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginFailoverWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginFailover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name 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 name of the region where the resource is + * located. + * + * @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 + * 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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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. + */ + beginFailover(resourceGroupName, locationName, failoverGroupName, 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._beginFailover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginFailover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. 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} locationName The name of the region where the resource is + * located. + * + * @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 + * 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 {InstanceFailoverGroup} - 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 InstanceFailoverGroup} 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. + */ + beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, 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._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Lists the failover groups in a 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 failover groups in a 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 {InstanceFailoverGroupListResult} - 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 InstanceFailoverGroupListResult} 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 = InstanceFailoverGroups; diff --git a/lib/services/sqlManagement2/lib/operations/managedDatabases.js b/lib/services/sqlManagement2/lib/operations/managedDatabases.js new file mode 100644 index 0000000000..4f1c1c5fe0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/managedDatabases.js @@ -0,0 +1,2851 @@ +/* + * 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; + + +/** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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. + * + * {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 _completeRestore(locationName, operationId, 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.beginCompleteRestore(locationName, operationId, 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); + }); + }); +} + +/** + * Gets a list of managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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 ManagedDatabaseListResult} 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 _listByInstance(resourceGroupName, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}/databases'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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['ManagedDatabaseListResult']().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 managed 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} managedInstanceName The name of the managed instance. + * + * @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 ManagedDatabase} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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['ManagedDatabase']().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. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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 ManagedDatabase} 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, managedInstanceName, 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, managedInstanceName, 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['ManagedDatabase']().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 managed 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} managedInstanceName The name of the managed instance. + * + * @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. + * + * {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, managedInstanceName, 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.beginDeleteMethod(resourceGroupName, managedInstanceName, 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); + }); + }); +} + + +/** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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 ManagedDatabase} 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, managedInstanceName, 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, managedInstanceName, 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['ManagedDatabase']().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); + }); + }); +} + +/** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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. + * + * {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 _beginCompleteRestore(locationName, operationId, 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 (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 (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 (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}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseRestoreAzureAsyncOperation/{operationId}/completeRestore'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CompleteDatabaseRestoreDefinition']().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); + }); +} + +/** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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 ManagedDatabase} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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 = '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['ManagedDatabase']().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['ManagedDatabase']().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['ManagedDatabase']().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 managed 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} managedInstanceName The name of the managed instance. + * + * @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. + * + * {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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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 = '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); + }); +} + +/** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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 ManagedDatabase} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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['ManagedDatabaseUpdate']().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['ManagedDatabase']().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 managed 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 ManagedDatabaseListResult} 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 _listByInstanceNext(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['ManagedDatabaseListResult']().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 ManagedDatabases. */ +class ManagedDatabases { + /** + * Create a ManagedDatabases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._completeRestore = _completeRestore; + this._listByInstance = _listByInstance; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCompleteRestore = _beginCompleteRestore; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listByInstanceNext = _listByInstanceNext; + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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. + */ + completeRestoreWithHttpOperationResponse(locationName, operationId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._completeRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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 {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. + */ + completeRestore(locationName, operationId, 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._completeRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._completeRestore(locationName, operationId, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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. + */ + listByInstanceWithHttpOperationResponse(resourceGroupName, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByInstance(resourceGroupName, managedInstanceName, 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 managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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 {ManagedDatabaseListResult} - 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 ManagedDatabaseListResult} 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. + */ + listByInstance(resourceGroupName, managedInstanceName, 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._listByInstance(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByInstance(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Gets a managed 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} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, 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 managed 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} managedInstanceName The name of the managed instance. + * + * @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 {ManagedDatabase} - 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 ManagedDatabase} 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, managedInstanceName, 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, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, managedInstanceName, 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, 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 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} [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 {ManagedDatabase} - 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 ManagedDatabase} 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, managedInstanceName, 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._createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the managed 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} managedInstanceName The name of the managed instance. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, databaseName, 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 managed 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} managedInstanceName The name of the managed instance. + * + * @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 {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, managedInstanceName, 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._deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback); + } + } + + /** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, 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; + }); + }); + } + + /** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} [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 {ManagedDatabase} - 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 ManagedDatabase} 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, managedInstanceName, 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, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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. + */ + beginCompleteRestoreWithHttpOperationResponse(locationName, operationId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCompleteRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name 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 {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. + */ + beginCompleteRestore(locationName, operationId, 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._beginCompleteRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCompleteRestore(locationName, operationId, parameters, 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, 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 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} [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 {ManagedDatabase} - 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 ManagedDatabase} 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, managedInstanceName, 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._beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the managed 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} managedInstanceName The name of the managed instance. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, 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 managed 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} managedInstanceName The name of the managed instance. + * + * @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 {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, managedInstanceName, 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._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback); + } + } + + /** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, 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; + }); + }); + } + + /** + * 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} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @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} [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 {ManagedDatabase} - 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 ManagedDatabase} 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, managedInstanceName, 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._beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of managed 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByInstanceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByInstanceNext(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 managed 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} [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 {ManagedDatabaseListResult} - 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 ManagedDatabaseListResult} 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. + */ + listByInstanceNext(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._listByInstanceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByInstanceNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ManagedDatabases; diff --git a/lib/services/sqlManagement2/lib/operations/managedInstances.js b/lib/services/sqlManagement2/lib/operations/managedInstances.js new file mode 100644 index 0000000000..97150b9f7a --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/managedInstances.js @@ -0,0 +1,2862 @@ +/* + * 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 list of all managed instances in the subscription. + * + * @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 ManagedInstanceListResult} 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 _list(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 (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/managedInstances'; + 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['ManagedInstanceListResult']().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 managed instances in a resource 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 {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 ManagedInstanceListResult} 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 _listByResourceGroup(resourceGroupName, 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 (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/managedInstances'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ManagedInstanceListResult']().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 managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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 ManagedInstance} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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['ManagedInstance']().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 a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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 ManagedInstance} 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, managedInstanceName, 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, managedInstanceName, 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['ManagedInstance']().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 managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, 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, managedInstanceName, 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 a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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 ManagedInstance} 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, managedInstanceName, 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, managedInstanceName, 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['ManagedInstance']().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 a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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 ManagedInstance} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedInstance']().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['ManagedInstance']().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['ManagedInstance']().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 a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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); + }); +} + +/** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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 ManagedInstance} 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, managedInstanceName, 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 (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName 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/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + 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['ManagedInstanceUpdate']().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['ManagedInstance']().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 all managed instances in the subscription. + * + * @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 ManagedInstanceListResult} 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 _listNext(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['ManagedInstanceListResult']().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 managed instances in a resource group. + * + * @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 ManagedInstanceListResult} 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 _listByResourceGroupNext(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['ManagedInstanceListResult']().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 ManagedInstances. */ +class ManagedInstances { + /** + * Create a ManagedInstances. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 all managed instances in the subscription. + * + * @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 {ManagedInstanceListResult} - 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 ManagedInstanceListResult} 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. + */ + list(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._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Gets a list of managed instances in a resource 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 {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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, 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 managed instances in a resource 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 {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 {ManagedInstanceListResult} - 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 ManagedInstanceListResult} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, 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 managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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 {ManagedInstance} - 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 ManagedInstance} 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, managedInstanceName, 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, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, 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 or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} [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 {ManagedInstance} - 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 ManagedInstance} 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, managedInstanceName, 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._createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, 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 managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, 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, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} [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 {ManagedInstance} - 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 ManagedInstance} 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, managedInstanceName, 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, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, 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 or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @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 {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} [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 {ManagedInstance} - 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 ManagedInstance} 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, managedInstanceName, 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._beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, 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 managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @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, managedInstanceName, 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, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance 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.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @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} [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 {ManagedInstance} - 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 ManagedInstance} 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, managedInstanceName, 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._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(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 all managed instances in the subscription. + * + * @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 {ManagedInstanceListResult} - 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 ManagedInstanceListResult} 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. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets a list of managed instances in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 managed instances in a resource group. + * + * @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 {ManagedInstanceListResult} - 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 ManagedInstanceListResult} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ManagedInstances; diff --git a/lib/services/sqlManagement2/lib/operations/shortTermRetentionPolicies.js b/lib/services/sqlManagement2/lib/operations/shortTermRetentionPolicies.js new file mode 100644 index 0000000000..1d94f15d13 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/shortTermRetentionPolicies.js @@ -0,0 +1,1231 @@ +/* + * 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 short 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 ShortTermRetentionPolicy} 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 policyName = 'default'; + 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}/backupShortTermRetentionPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + 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) { + 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['ShortTermRetentionPolicy']().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 a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 ShortTermRetentionPolicy} 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['ShortTermRetentionPolicy']().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 a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 ShortTermRetentionPolicy} 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.'); + } + + // 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['ShortTermRetentionPolicy']().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 a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 ShortTermRetentionPolicy} 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) { + /* 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 policyName = 'default'; + 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.'); + } + 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}/backupShortTermRetentionPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + 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) { + 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['ShortTermRetentionPolicy']().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['ShortTermRetentionPolicy']().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 a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 ShortTermRetentionPolicy} 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) { + /* 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 policyName = 'default'; + 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.'); + } + 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}/backupShortTermRetentionPolicies/{policyName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + 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) { + 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['ShortTermRetentionPolicy']().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['ShortTermRetentionPolicy']().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 ShortTermRetentionPolicies. */ +class ShortTermRetentionPolicies { + /** + * Create a ShortTermRetentionPolicies. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdate = _beginUpdate; + } + + /** + * Gets a database's short 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 + * + * @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 short 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 {ShortTermRetentionPolicy} - 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 ShortTermRetentionPolicy} 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); + } + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + 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); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 {ShortTermRetentionPolicy} - 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 ShortTermRetentionPolicy} 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, 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._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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; + }); + }); + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 {ShortTermRetentionPolicy} - 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 ShortTermRetentionPolicy} 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); + } + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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, 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) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 {ShortTermRetentionPolicy} - 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 ShortTermRetentionPolicy} 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, 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._beginCreateOrUpdate(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); + } + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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. + */ + beginUpdateWithHttpOperationResponse(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) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a database's short 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 short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * + * @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 {ShortTermRetentionPolicy} - 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 ShortTermRetentionPolicy} 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) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(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); + } + } + +} + +module.exports = ShortTermRetentionPolicies; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 951e647e01..9063d7659f 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -81,6 +81,7 @@ export default class SqlManagementClient extends AzureServiceClient { databaseAutomaticTuningOperations: operations.DatabaseAutomaticTuningOperations; encryptionProtectors: operations.EncryptionProtectors; failoverGroups: operations.FailoverGroups; + managedInstances: operations.ManagedInstances; operations: operations.Operations; serverKeys: operations.ServerKeys; syncAgents: operations.SyncAgents; @@ -90,12 +91,15 @@ export default class SqlManagementClient extends AzureServiceClient { virtualNetworkRules: operations.VirtualNetworkRules; longTermRetentionBackups: operations.LongTermRetentionBackups; backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; + managedDatabases: operations.ManagedDatabases; serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; serverDnsAliases: operations.ServerDnsAliases; restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; capabilities: operations.Capabilities; + instanceFailoverGroups: operations.InstanceFailoverGroups; + shortTermRetentionPolicies: operations.ShortTermRetentionPolicies; } export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index 4c2f9a8ebd..184fb325a5 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -98,6 +98,7 @@ class SqlManagementClient extends ServiceClient { this.databaseAutomaticTuningOperations = new operations.DatabaseAutomaticTuningOperations(this); this.encryptionProtectors = new operations.EncryptionProtectors(this); this.failoverGroups = new operations.FailoverGroups(this); + this.managedInstances = new operations.ManagedInstances(this); this.operations = new operations.Operations(this); this.serverKeys = new operations.ServerKeys(this); this.syncAgents = new operations.SyncAgents(this); @@ -107,12 +108,15 @@ class SqlManagementClient extends ServiceClient { this.virtualNetworkRules = new operations.VirtualNetworkRules(this); this.longTermRetentionBackups = new operations.LongTermRetentionBackups(this); this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); + this.managedDatabases = new operations.ManagedDatabases(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.capabilities = new operations.Capabilities(this); + this.instanceFailoverGroups = new operations.InstanceFailoverGroups(this); + this.shortTermRetentionPolicies = new operations.ShortTermRetentionPolicies(this); this.models = models; msRest.addSerializationMixin(this); } From 5acbe03361ef5c6625089624b5914d964db7eba5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 1 May 2018 09:23:17 +0000 Subject: [PATCH 4/4] Generated from 44bbc7e2975528efd4a0e39d54876629314aad5c Merge branch 'master' into master --- .../sqlManagement2/lib/models/index.d.ts | 115 +++++ .../sqlManagement2/lib/models/index.js | 6 + .../sqlManagement2/lib/operations/index.d.ts | 427 ++++++++++++++++++ .../sqlManagement2/lib/operations/index.js | 1 + .../lib/sqlManagementClient.d.ts | 1 + .../sqlManagement2/lib/sqlManagementClient.js | 1 + 6 files changed, 551 insertions(+) diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index 363749ddaa..d7d687d2a0 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -3066,6 +3066,109 @@ export interface ElasticPoolUpdate { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the VulnerabilityAssessmentRecurringScansProperties class. + * @constructor + * Properties of a Vulnerability Assessment recurring scans. + * + * @member {boolean} [isEnabled] Recurring scans state. + * @member {boolean} [emailSubscriptionAdmins] Specifies that the schedule scan + * notification will be is sent to the subscription administrators. Default + * value: true . + * @member {array} [emails] Specifies an array of e-mail addresses to which the + * scan notification is sent. + */ +export interface VulnerabilityAssessmentRecurringScansProperties { + isEnabled?: boolean; + emailSubscriptionAdmins?: boolean; + emails?: string[]; +} + +/** + * @class + * Initializes a new instance of the DatabaseVulnerabilityAssessment class. + * @constructor + * A database vulnerability assessment. + * + * @member {string} [storageContainerPath] A blob storage container path to + * hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * @member {string} [storageContainerSasKey] A shared access signature (SAS + * Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. + * @member {object} [recurringScans] The recurring scans settings + * @member {boolean} [recurringScans.isEnabled] Recurring scans state. + * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that + * the schedule scan notification will be is sent to the subscription + * administrators. + * @member {array} [recurringScans.emails] Specifies an array of e-mail + * addresses to which the scan notification is sent. + */ +export interface DatabaseVulnerabilityAssessment extends ProxyResource { + storageContainerPath?: string; + storageContainerSasKey?: string; + recurringScans?: VulnerabilityAssessmentRecurringScansProperties; +} + +/** + * @class + * Initializes a new instance of the VulnerabilityAssessmentScanError class. + * @constructor + * Properties of a vulnerability assessment scan error. + * + * @member {string} [code] The error code. + * @member {string} [message] The error message. + */ +export interface VulnerabilityAssessmentScanError { + readonly code?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the VulnerabilityAssessmentScanRecord class. + * @constructor + * A vulnerability assessment scan record. + * + * @member {string} [scanId] The scan ID. + * @member {string} [triggerType] The scan trigger type. Possible values + * include: 'OnDemand', 'Recurring' + * @member {string} [state] The scan status. Possible values include: 'Passed', + * 'Failed', 'FailedToRun', 'InProgress' + * @member {date} [startTime] The scan start time (UTC). + * @member {date} [endTime] The scan end time (UTC). + * @member {array} [errors] The scan errors. + * @member {string} [storageContainerPath] The scan results storage container + * path. + * @member {number} [numberOfFailedSecurityChecks] The number of failed + * security checks. + */ +export interface VulnerabilityAssessmentScanRecord extends ProxyResource { + readonly scanId?: string; + readonly triggerType?: string; + readonly state?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly errors?: VulnerabilityAssessmentScanError[]; + readonly storageContainerPath?: string; + readonly numberOfFailedSecurityChecks?: number; +} + +/** + * @class + * Initializes a new instance of the DatabaseVulnerabilityAssessmentScansExport class. + * @constructor + * A database Vulnerability Assessment scan export resource. + * + * @member {string} [exportedReportLocation] Location of the exported report + * (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + */ +export interface DatabaseVulnerabilityAssessmentScansExport extends ProxyResource { + readonly exportedReportLocation?: string; +} + /** * @class * Initializes a new instance of the InstanceFailoverGroupReadWriteEndpoint class. @@ -3650,6 +3753,18 @@ export interface ElasticPoolOperationListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the InstanceFailoverGroupListResult class. diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 86aa7c826a..e5d2ab0c0e 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -125,6 +125,11 @@ exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); exports.ElasticPoolPerDatabaseSettings = require('./elasticPoolPerDatabaseSettings'); exports.ElasticPool = require('./elasticPool'); exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); +exports.VulnerabilityAssessmentRecurringScansProperties = require('./vulnerabilityAssessmentRecurringScansProperties'); +exports.DatabaseVulnerabilityAssessment = require('./databaseVulnerabilityAssessment'); +exports.VulnerabilityAssessmentScanError = require('./vulnerabilityAssessmentScanError'); +exports.VulnerabilityAssessmentScanRecord = require('./vulnerabilityAssessmentScanRecord'); +exports.DatabaseVulnerabilityAssessmentScansExport = require('./databaseVulnerabilityAssessmentScansExport'); exports.InstanceFailoverGroupReadWriteEndpoint = require('./instanceFailoverGroupReadWriteEndpoint'); exports.InstanceFailoverGroupReadOnlyEndpoint = require('./instanceFailoverGroupReadOnlyEndpoint'); exports.PartnerRegionInfo = require('./partnerRegionInfo'); @@ -173,4 +178,5 @@ exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); +exports.VulnerabilityAssessmentScanRecordListResult = require('./vulnerabilityAssessmentScanRecordListResult'); exports.InstanceFailoverGroupListResult = require('./instanceFailoverGroupListResult'); diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index bbd70b7886..adf273f002 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -20080,6 +20080,433 @@ export interface Capabilities { listByLocation(locationName: string, options: { include? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * DatabaseVulnerabilityAssessmentScans + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseVulnerabilityAssessmentScans { + + + /** + * Gets a vulnerability assessment scan record of 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 {string} scanId The vulnerability assessment scan Id of the scan 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, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a vulnerability assessment scan record of 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 {string} scanId The vulnerability assessment scan Id of the scan 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 {VulnerabilityAssessmentScanRecord} - 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. + * + * {VulnerabilityAssessmentScanRecord} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecord} 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, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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. + */ + executeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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 {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. + */ + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + execute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the vulnerability assessment scans of 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. + * + * @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>; + + /** + * Lists the vulnerability assessment scans of 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. + * + * @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 {VulnerabilityAssessmentScanRecordListResult} - 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. + * + * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecordListResult} + * 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; + + + /** + * Convert an existing scan result to a human readable format. If already + * exists nothing happens + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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 scanned database. + * + * @param {string} scanId The vulnerability assessment scan Id. + * + * @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, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Convert an existing scan result to a human readable format. If already + * exists nothing happens + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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 scanned database. + * + * @param {string} scanId The vulnerability assessment scan Id. + * + * @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 {DatabaseVulnerabilityAssessmentScansExport} - 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. + * + * {DatabaseVulnerabilityAssessmentScansExport} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseVulnerabilityAssessmentScansExport} + * 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, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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. + */ + beginExecuteWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Executes a Vulnerability Assessment database scan. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the 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} scanId The vulnerability assessment scan Id of the scan 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 {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. + */ + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, callback: ServiceCallback): void; + beginExecute(resourceGroupName: string, serverName: string, databaseName: string, scanId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the vulnerability assessment scans of 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|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the vulnerability assessment scans of 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 {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 {VulnerabilityAssessmentScanRecordListResult} - 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. + * + * {VulnerabilityAssessmentScanRecordListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VulnerabilityAssessmentScanRecordListResult} + * 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 * InstanceFailoverGroups diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 216e19d49f..2acaf94c6e 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -58,5 +58,6 @@ exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); exports.Capabilities = require('./capabilities'); +exports.DatabaseVulnerabilityAssessmentScans = require('./databaseVulnerabilityAssessmentScans'); exports.InstanceFailoverGroups = require('./instanceFailoverGroups'); exports.ShortTermRetentionPolicies = require('./shortTermRetentionPolicies'); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 9063d7659f..61b01b928c 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -98,6 +98,7 @@ export default class SqlManagementClient extends AzureServiceClient { databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; capabilities: operations.Capabilities; + databaseVulnerabilityAssessmentScans: operations.DatabaseVulnerabilityAssessmentScans; instanceFailoverGroups: operations.InstanceFailoverGroups; shortTermRetentionPolicies: operations.ShortTermRetentionPolicies; } diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index 184fb325a5..0c240447cd 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -115,6 +115,7 @@ class SqlManagementClient extends ServiceClient { this.databaseOperations = new operations.DatabaseOperations(this); this.elasticPoolOperations = new operations.ElasticPoolOperations(this); this.capabilities = new operations.Capabilities(this); + this.databaseVulnerabilityAssessmentScans = new operations.DatabaseVulnerabilityAssessmentScans(this); this.instanceFailoverGroups = new operations.InstanceFailoverGroups(this); this.shortTermRetentionPolicies = new operations.ShortTermRetentionPolicies(this); this.models = models;