From 13b4f6963d9ea02a11aec702bfc8bcc8fcf12327 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 22 Mar 2018 04:13:09 +0000 Subject: [PATCH 1/4] Generated from a4d7b3d6e85107afd08f8a8d75675c67a15d2a4f Added package-composite-v3 tag. Differences against package-composite-v2: - 2014-04-01/recommendedElasticPoolsDecoupled.json used instead of 2014-04-01/recommendedElasticPools.json so that recommendedElasticPools is separated from databases. This allows us to update database and recommendedElasticPools apis independently. - databases.json, elasticPools.json, and capabilities.json updated from 2014-04-01 to 2017-10-01-preview versions. - 2017-03-01-preview/renameDatabase.json removed since the rename api is there in 2017-10-01-preview/databases.json --- .../sqlManagement2/lib/models/index.d.ts | 154 +++---- .../sqlManagement2/lib/models/index.js | 8 +- .../sqlManagement2/lib/operations/index.d.ts | 426 +++++++++--------- .../sqlManagement2/lib/operations/index.js | 2 +- .../lib/sqlManagementClient.d.ts | 2 +- .../sqlManagement2/lib/sqlManagementClient.js | 2 +- 6 files changed, 297 insertions(+), 297 deletions(-) diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index 8809868c22..898e6088fc 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -1032,63 +1032,6 @@ export interface ElasticPoolActivity extends ProxyResource { 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; -} - -/** - * @class - * Initializes a new instance of the RecommendedElasticPool class. - * @constructor - * Represents a recommented elastic pool. - * - * @member {string} [databaseEdition] The edition of the recommended elastic - * pool. The ElasticPoolEdition enumeration contains all the valid editions. - * Possible values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The DTU for the recommended elastic pool. - * @member {number} [databaseDtuMin] The minimum DTU for the database. - * @member {number} [databaseDtuMax] The maximum DTU for the database. - * @member {number} [storageMB] Gets storage size in megabytes. - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [maxObservedDtu] Gets maximum observed DTU. - * @member {number} [maxObservedStorageMB] Gets maximum observed storage in - * megabytes. - * @member {array} [databases] The list of databases in this pool. Expanded - * property - * @member {array} [metrics] The list of databases housed in the server. - * Expanded property - */ -export interface RecommendedElasticPool extends ProxyResource { - readonly databaseEdition?: string; - dtu?: number; - databaseDtuMin?: number; - databaseDtuMax?: number; - storageMB?: number; - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly maxObservedDtu?: number; - readonly maxObservedStorageMB?: number; - readonly databases?: Database[]; - readonly metrics?: RecommendedElasticPoolMetric[]; -} - /** * @class * Initializes a new instance of the DatabaseSecurityAlertPolicy class. @@ -1558,6 +1501,63 @@ export interface MetricDefinition { readonly metricAvailabilities?: MetricAvailability[]; } +/** + * @class + * Initializes a new instance of the RecommendedElasticPoolMetric class. + * @constructor + * Represents recommended elastic pool metric. + * + * @member {date} [dateTime] The time of metric (ISO8601 format). + * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). + * See + * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + * @member {number} [sizeGB] Gets or sets size in gigabytes. + */ +export interface RecommendedElasticPoolMetric { + dateTime?: Date; + dtu?: number; + sizeGB?: number; +} + +/** + * @class + * Initializes a new instance of the RecommendedElasticPool class. + * @constructor + * Represents a recommented elastic pool. + * + * @member {string} [databaseEdition] The edition of the recommended elastic + * pool. The ElasticPoolEdition enumeration contains all the valid editions. + * Possible values include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The DTU for the recommended elastic pool. + * @member {number} [databaseDtuMin] The minimum DTU for the database. + * @member {number} [databaseDtuMax] The maximum DTU for the database. + * @member {number} [storageMB] Gets storage size in megabytes. + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 + * format). + * @member {number} [maxObservedDtu] Gets maximum observed DTU. + * @member {number} [maxObservedStorageMB] Gets maximum observed storage in + * megabytes. + * @member {array} [databases] The list of databases in this pool. Expanded + * property + * @member {array} [metrics] The list of databases housed in the server. + * Expanded property + */ +export interface RecommendedElasticPool extends ProxyResource { + readonly databaseEdition?: string; + dtu?: number; + databaseDtuMin?: number; + databaseDtuMax?: number; + storageMB?: number; + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly maxObservedDtu?: number; + readonly maxObservedStorageMB?: number; + readonly databases?: Database[]; + readonly metrics?: RecommendedElasticPoolMetric[]; +} + /** * @class * Initializes a new instance of the ReplicationLink class. @@ -2756,6 +2756,26 @@ export interface FirewallRuleListResult extends Array { export interface GeoBackupPolicyListResult 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 ReplicationLinkListResult class. @@ -2816,26 +2836,6 @@ export interface ElasticPoolActivityListResult extends Array { } -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListResult class. - * @constructor - * Represents the response to a list recommended elastic pool request. - * - */ -export interface RecommendedElasticPoolListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListMetricsResult class. - * @constructor - * Represents the response to a list recommended elastic pool metrics request. - * - */ -export interface RecommendedElasticPoolListMetricsResult extends Array { -} - /** * @class * Initializes a new instance of the ServiceTierAdvisorListResult class. diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 936e303e18..5948e14029 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -45,8 +45,6 @@ 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'); @@ -63,6 +61,8 @@ 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'); @@ -120,14 +120,14 @@ exports.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); exports.ElasticPoolListResult = require('./elasticPoolListResult'); exports.FirewallRuleListResult = require('./firewallRuleListResult'); exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); +exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); +exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ReplicationLinkListResult = require('./replicationLinkListResult'); exports.ServerAdministratorListResult = require('./serverAdministratorListResult'); exports.ServerCommunicationLinkListResult = require('./serverCommunicationLinkListResult'); exports.ServiceObjectiveListResult = require('./serviceObjectiveListResult'); exports.ElasticPoolActivityListResult = require('./elasticPoolActivityListResult'); exports.ElasticPoolDatabaseActivityListResult = require('./elasticPoolDatabaseActivityListResult'); -exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); -exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ServiceTierAdvisorListResult = require('./serviceTierAdvisorListResult'); exports.TransparentDataEncryptionActivityListResult = require('./transparentDataEncryptionActivityListResult'); exports.ServerUsageListResult = require('./serverUsageListResult'); diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index c6a881e1ec..3af2447f44 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -6438,6 +6438,219 @@ export interface GeoBackupPolicies { listByDatabase(resourceGroupName: string, serverName: string, databaseName: 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; + + + /** + * 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 + * 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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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 {RecommendedElasticPoolListMetricsResult} - 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. + * + * {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. + */ + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * ReplicationLinks @@ -8060,219 +8273,6 @@ export interface ElasticPoolDatabaseActivities { 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; - - - /** - * 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 - * 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. - */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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 - * 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 {RecommendedElasticPoolListMetricsResult} - 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. - * - * {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. - */ - 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 diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index ed7f47bc24..75f2edb211 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -26,13 +26,13 @@ exports.DataMaskingRules = require('./dataMaskingRules'); exports.ElasticPools = require('./elasticPools'); exports.FirewallRules = require('./firewallRules'); exports.GeoBackupPolicies = require('./geoBackupPolicies'); +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'); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index a37373a060..33a18a4c65 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -66,13 +66,13 @@ export default class SqlManagementClient extends AzureServiceClient { elasticPools: operations.ElasticPools; firewallRules: operations.FirewallRules; geoBackupPolicies: operations.GeoBackupPolicies; + 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; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index cd18ce1370..fa33d9f04e 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -83,13 +83,13 @@ class SqlManagementClient extends ServiceClient { this.elasticPools = new operations.ElasticPools(this); this.firewallRules = new operations.FirewallRules(this); this.geoBackupPolicies = new operations.GeoBackupPolicies(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); From a3ad742e981350dce37ef7c7691207d7e29b725b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 23 Mar 2018 22:34:18 +0000 Subject: [PATCH 2/4] Generated from 60866124ae22fe440362fd0cd1faf52c55431b2b Fixed model validation errors by making minor example edits --- .../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 | 4058 ++++++----- .../sqlManagement2/lib/models/index.js | 62 +- .../lib/models/licenseTypeCapability.js | 73 + .../lib/models/locationCapabilities.js | 49 +- .../lib/models/logSizeCapability.js | 64 + .../managedInstanceEditionCapability.js | 92 + .../models/managedInstanceFamilyCapability.js | 151 + .../models/managedInstanceVcoresCapability.js | 82 + .../managedInstanceVersionCapability.js | 93 + .../lib/models/maxSizeCapability.js | 20 +- .../lib/models/maxSizeRangeCapability.js | 127 + .../lib/models/performanceLevelCapability.js | 63 + .../lib/models/recommendedElasticPool.js | 4 +- .../lib/models/serverVersionCapability.js | 33 +- .../lib/models/serviceObjectiveCapability.js | 101 +- lib/services/sqlManagement2/lib/models/sku.js | 87 + .../lib/operations/capabilities.js | 61 +- .../lib/operations/databases.js | 6439 ++++++++--------- .../lib/operations/elasticPools.js | 2258 +++--- .../sqlManagement2/lib/operations/index.d.ts | 4212 +++++------ .../sqlManagement2/lib/operations/index.js | 6 +- .../lib/sqlManagementClient.d.ts | 6 +- .../sqlManagement2/lib/sqlManagementClient.js | 6 +- 35 files changed, 10859 insertions(+), 8846 deletions(-) create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMaxPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseMinPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerDatabaseSettings.js create mode 100644 lib/services/sqlManagement2/lib/models/elasticPoolPerformanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/licenseTypeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/logSizeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/performanceLevelCapability.js create mode 100644 lib/services/sqlManagement2/lib/models/sku.js diff --git a/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 898e6088fc..e291789c89 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -108,212 +108,6 @@ export interface RestorableDroppedDatabase extends ProxyResource { readonly earliestRestoreDate?: Date; } -/** - * @class - * Initializes a new instance of the MaxSizeCapability class. - * @constructor - * The maximum size limits for a database. - * - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). - * @member {string} [unit] The units that the limit is expressed in. Possible - * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' - * @member {string} [status] The status of the maximum size capability. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - */ -export interface MaxSizeCapability { - readonly limit?: number; - readonly unit?: string; - readonly status?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceObjectiveCapability class. - * @constructor - * The service objectives capability. - * - * @member {string} [name] The service objective name. - * @member {string} [status] The status of the service objective. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {string} [unit] Unit type used to measure service objective - * performance level. Possible values include: 'DTU' - * @member {number} [value] Performance level value. - * @member {uuid} [id] The unique ID of the service objective. - * @member {array} [supportedMaxSizes] The list of supported maximum database - * sizes for this service objective. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). - * @member {string} [includedMaxSize.unit] The units that the limit is - * expressed in. Possible values include: 'Megabytes', 'Gigabytes', - * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' - */ -export interface ServiceObjectiveCapability { - readonly name?: string; - readonly status?: string; - readonly unit?: string; - readonly value?: number; - readonly id?: string; - readonly supportedMaxSizes?: MaxSizeCapability[]; - readonly includedMaxSize?: MaxSizeCapability; -} - -/** - * @class - * Initializes a new instance of the EditionCapability class. - * @constructor - * The database edition capabilities. - * - * @member {string} [name] The edition name. - * @member {string} [status] The status of the edition. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedServiceLevelObjectives] The list of supported - * service objectives for the edition. - * @member {boolean} [zoneRedundant] Whether or not zone redundancy is - * supported for the edition. - */ -export interface EditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; - readonly zoneRedundant?: boolean; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolPerDatabaseMinDtuCapability class. - * @constructor - * The minimum per-database DTU capability. - * - * @member {number} [limit] The maximum DTUs per database. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - */ -export interface ElasticPoolPerDatabaseMinDtuCapability { - readonly limit?: number; - readonly status?: string; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolPerDatabaseMaxDtuCapability class. - * @constructor - * The max per-database DTU capability. - * - * @member {number} [limit] The maximum DTUs per database. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedPerDatabaseMinDtus] The list of supported min - * database DTUs. - */ -export interface ElasticPoolPerDatabaseMaxDtuCapability { - readonly limit?: number; - readonly status?: string; - readonly supportedPerDatabaseMinDtus?: ElasticPoolPerDatabaseMinDtuCapability[]; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolDtuCapability class. - * @constructor - * The Elastic Pool DTU capability. - * - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). - * @member {number} [maxDatabaseCount] The maximum number of databases - * supported. - * @member {string} [status] The status of the capability. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedMaxSizes] The list of supported max sizes. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). - * @member {string} [includedMaxSize.unit] The units that the limit is - * expressed in. Possible values include: 'Megabytes', 'Gigabytes', - * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' - * @member {array} [supportedPerDatabaseMaxSizes] The list of supported max - * database sizes. - * @member {array} [supportedPerDatabaseMaxDtus] The list of supported max - * database DTUs. - */ -export interface ElasticPoolDtuCapability { - readonly limit?: number; - readonly maxDatabaseCount?: number; - readonly status?: string; - readonly supportedMaxSizes?: MaxSizeCapability[]; - readonly includedMaxSize?: MaxSizeCapability; - readonly supportedPerDatabaseMaxSizes?: MaxSizeCapability[]; - readonly supportedPerDatabaseMaxDtus?: ElasticPoolPerDatabaseMaxDtuCapability[]; -} - -/** - * @class - * Initializes a new instance of the ElasticPoolEditionCapability class. - * @constructor - * The elastic pool edition capabilities. - * - * @member {string} [name] The elastic pool edition name. - * @member {string} [status] The status of the elastic pool edition. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedElasticPoolDtus] The list of supported elastic - * pool DTU levels for the edition. - * @member {boolean} [zoneRedundant] Whether or not zone redundancy is - * supported for the edition. - */ -export interface ElasticPoolEditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedElasticPoolDtus?: ElasticPoolDtuCapability[]; - readonly zoneRedundant?: boolean; -} - -/** - * @class - * Initializes a new instance of the ServerVersionCapability class. - * @constructor - * The server capabilities. - * - * @member {string} [name] The server version name. - * @member {string} [status] The status of the server version. Possible values - * include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedEditions] The list of supported database editions. - * @member {array} [supportedElasticPoolEditions] The list of supported elastic - * pool editions. - */ -export interface ServerVersionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedEditions?: EditionCapability[]; - readonly supportedElasticPoolEditions?: ElasticPoolEditionCapability[]; -} - -/** - * @class - * Initializes a new instance of the LocationCapabilities class. - * @constructor - * The capabilities for a location. - * - * @member {string} [name] The location name. - * @member {string} [status] Azure SQL Database's status for the location. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {array} [supportedServerVersions] The list of supported server - * versions. - */ -export interface LocationCapabilities { - readonly name?: string; - readonly status?: string; - readonly supportedServerVersions?: ServerVersionCapability[]; -} - /** * @class * Initializes a new instance of the CheckNameAvailabilityRequest class. @@ -368,113 +162,662 @@ export interface ServerConnectionPolicy extends ProxyResource { /** * @class - * Initializes a new instance of the SloUsageMetric class. + * Initializes a new instance of the DatabaseSecurityAlertPolicy class. * @constructor - * A Slo Usage Metric. + * Contains information about a database Threat Detection policy. * - * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'System', 'System0', 'System1', - * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', - * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', - * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', - * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', - * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', - * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', - * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO - * usage metric. - * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO - * usage metric. + * @member {string} [location] The geo-location where the resource lives + * @member {string} [kind] Resource kind. + * @member {string} state Specifies the state of the policy. If state is + * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible + * values include: 'New', 'Enabled', 'Disabled' + * @member {string} [disabledAlerts] Specifies the semicolon-separated list of + * alerts that are disabled, or empty string to disable no alerts. Possible + * values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; + * Usage_Anomaly. + * @member {string} [emailAddresses] Specifies the semicolon-separated list of + * e-mail addresses to which the alert is sent. + * @member {string} [emailAccountAdmins] Specifies that the alert is sent to + * the account administrators. Possible values include: 'Enabled', 'Disabled' + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all + * Threat Detection audit logs. If state is Enabled, storageEndpoint is + * required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the Threat Detection audit storage account. If state is Enabled, + * storageAccountAccessKey is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * Threat Detection audit logs. + * @member {string} [useServerDefault] Specifies whether to use the default + * server policy. Possible values include: 'Enabled', 'Disabled' */ -export interface SloUsageMetric { - readonly serviceLevelObjective?: string; - readonly serviceLevelObjectiveId?: string; - readonly inRangeTimeRatio?: number; +export interface DatabaseSecurityAlertPolicy extends ProxyResource { + location?: string; + readonly kind?: string; + state: string; + disabledAlerts?: string; + emailAddresses?: string; + emailAccountAdmins?: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + useServerDefault?: string; } /** * @class - * Initializes a new instance of the ServiceTierAdvisor class. + * Initializes a new instance of the DataMaskingPolicy class. * @constructor - * Represents a Service Tier Advisor. + * Represents a database data masking policy. * - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [activeTimeRatio] The activeTimeRatio for service tier - * advisor. - * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. - * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. - * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. - * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier - * advisor. - * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets - * serviceLevelObjectiveUsageMetrics for the service tier advisor. - * @member {string} [currentServiceLevelObjective] Gets or sets - * currentServiceLevelObjective for service tier advisor. - * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets - * currentServiceLevelObjectiveId for service tier advisor. - * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or - * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or - * sets usageBasedRecommendationServiceLevelObjectiveId for service tier - * advisor. - * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets - * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjective for service - * tier advisor. - * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets - * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service - * tier advisor. - * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets - * overallRecommendationServiceLevelObjective for service tier advisor. - * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets - * overallRecommendationServiceLevelObjectiveId for service tier advisor. - * @member {number} [confidence] Gets or sets confidence for service tier - * advisor. - */ -export interface ServiceTierAdvisor extends ProxyResource { - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly activeTimeRatio?: number; - readonly minDtu?: number; - readonly avgDtu?: number; - readonly maxDtu?: number; - readonly maxSizeInGB?: number; - readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; - readonly currentServiceLevelObjective?: string; - readonly currentServiceLevelObjectiveId?: string; - readonly usageBasedRecommendationServiceLevelObjective?: string; - readonly usageBasedRecommendationServiceLevelObjectiveId?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; - readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; - readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; - readonly overallRecommendationServiceLevelObjective?: string; - readonly overallRecommendationServiceLevelObjectiveId?: string; - readonly confidence?: number; + * @member {string} dataMaskingState The state of the data masking policy. + * Possible values include: 'Disabled', 'Enabled' + * @member {string} [exemptPrincipals] The list of the exempt principals. + * Specifies the semicolon-separated list of database users for which the data + * masking policy does not apply. The specified users receive data results + * without masking for all of the database queries. + * @member {string} [applicationPrincipals] The list of the application + * principals. This is a legacy parameter and is no longer used. + * @member {string} [maskingLevel] The masking level. This is a legacy + * parameter and is no longer used. + * @member {string} [location] The location of the data masking policy. + * @member {string} [kind] The kind of data masking policy. Metadata, used for + * Azure portal. + */ +export interface DataMaskingPolicy extends ProxyResource { + dataMaskingState: string; + exemptPrincipals?: string; + readonly applicationPrincipals?: string; + readonly maskingLevel?: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the DataMaskingRule class. + * @constructor + * Represents a database data masking rule. + * + * @member {string} [dataMaskingRuleId] The rule Id. + * @member {string} [aliasName] The alias name. This is a legacy parameter and + * is no longer used. + * @member {string} [ruleState] The rule state. Used to delete a rule. To + * delete an existing rule, specify the schemaName, tableName, columnName, + * maskingFunction, and specify ruleState as disabled. However, if the rule + * doesn't already exist, the rule will be created with ruleState set to + * enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} schemaName The schema name on which the data masking rule + * is applied. + * @member {string} tableName The table name on which the data masking rule is + * applied. + * @member {string} columnName The column name on which the data masking rule + * is applied. + * @member {string} maskingFunction The masking function that is used for the + * data masking rule. Possible values include: 'Default', 'CCN', 'Email', + * 'Number', 'SSN', 'Text' + * @member {string} [numberFrom] The numberFrom property of the masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [numberTo] The numberTo property of the data masking rule. + * Required if maskingFunction is set to Number, otherwise this parameter will + * be ignored. + * @member {string} [prefixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked in the beginning of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [suffixSize] If maskingFunction is set to Text, the number + * of characters to show unmasked at the end of the string. Otherwise, this + * parameter will be ignored. + * @member {string} [replacementString] If maskingFunction is set to Text, the + * character to use for masking the unexposed part of the string. Otherwise, + * this parameter will be ignored. + * @member {string} [location] The location of the data masking rule. + * @member {string} [kind] The kind of Data Masking Rule. Metadata, used for + * Azure portal. + */ +export interface DataMaskingRule extends ProxyResource { + readonly dataMaskingRuleId?: string; + aliasName?: string; + ruleState?: string; + schemaName: string; + tableName: string; + columnName: string; + maskingFunction: string; + numberFrom?: string; + numberTo?: string; + prefixSize?: string; + suffixSize?: string; + replacementString?: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the FirewallRule class. + * @constructor + * Represents a server firewall rule. + * + * @member {string} [kind] Kind of server that contains this firewall rule. + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {string} startIpAddress The start IP address of the firewall rule. + * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP + * addresses. + * @member {string} endIpAddress The end IP address of the firewall rule. Must + * be IPv4 format. Must be greater than or equal to startIpAddress. Use value + * '0.0.0.0' to represent all Azure-internal IP addresses. + */ +export interface FirewallRule extends ProxyResource { + readonly kind?: string; + readonly location?: string; + startIpAddress: string; + endIpAddress: string; +} + +/** + * @class + * Initializes a new instance of the GeoBackupPolicy class. + * @constructor + * A database geo backup policy. + * + * @member {string} state The state of the geo backup policy. Possible values + * include: 'Disabled', 'Enabled' + * @member {string} [storageType] The storage type of the geo backup policy. + * @member {string} [kind] Kind of geo backup policy. This is metadata used + * for the Azure portal experience. + * @member {string} [location] Backup policy location. + */ +export interface GeoBackupPolicy extends ProxyResource { + state: string; + readonly storageType?: string; + readonly kind?: string; + readonly location?: string; +} + +/** + * @class + * Initializes a new instance of the ImportExtensionRequest class. + * @constructor + * Import database parameters. + * + * @member {string} [name] The name of the extension. + * @member {string} [type] The type of the extension. + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + */ +export interface ImportExtensionRequest { + name?: string; + type?: string; + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; +} + +/** + * @class + * Initializes a new instance of the ImportExportResponse class. + * @constructor + * Response for Import/Export Get operation. + * + * @member {string} [requestType] The request type of the operation. + * @member {uuid} [requestId] The request type of the operation. + * @member {string} [serverName] The name of the server. + * @member {string} [databaseName] The name of the database. + * @member {string} [status] The status message returned from the server. + * @member {string} [lastModifiedTime] The operation status last modified time. + * @member {string} [queuedTime] The operation queued time. + * @member {string} [blobUri] The blob uri. + * @member {string} [errorMessage] The error message returned from the server. + */ +export interface ImportExportResponse extends ProxyResource { + readonly requestType?: string; + readonly requestId?: string; + readonly serverName?: string; + readonly databaseName?: string; + readonly status?: string; + readonly lastModifiedTime?: string; + readonly queuedTime?: string; + readonly blobUri?: string; + readonly errorMessage?: string; +} + +/** + * @class + * Initializes a new instance of the ExportRequest class. + * @constructor + * Export database parameters. + * + * @member {string} storageKeyType The type of the storage key to use. Possible + * values include: 'StorageAccessKey', 'SharedAccessKey' + * @member {string} storageKey The storage key to use. If storage key type is + * SharedAccessKey, it must be preceded with a "?." + * @member {string} storageUri The storage uri to use. + * @member {string} administratorLogin The name of the SQL administrator. + * @member {string} administratorLoginPassword The password of the SQL + * administrator. + * @member {string} [authenticationType] The authentication type. Possible + * values include: 'SQL', 'ADPassword'. Default value: 'SQL' . + */ +export interface ExportRequest { + storageKeyType: string; + storageKey: string; + storageUri: string; + administratorLogin: string; + administratorLoginPassword: string; + authenticationType?: string; +} + +/** + * @class + * Initializes a new instance of the ImportRequest class. + * @constructor + * Import database parameters. + * + * @member {string} databaseName The name of the database to import. + * @member {string} edition The edition for the database being created. + * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @member {string} serviceObjectiveName The name of the service objective to + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', + * 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', + * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', + * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' + * @member {string} maxSizeBytes The maximum size for the newly imported + * database. + */ +export interface ImportRequest extends ExportRequest { + databaseName: string; + edition: string; + serviceObjectiveName: string; + maxSizeBytes: string; +} + +/** + * @class + * Initializes a new instance of the MetricValue class. + * @constructor + * Represents database metrics. + * + * @member {number} [count] The number of values for the metric. + * @member {number} [average] The average value of the metric. + * @member {number} [maximum] The max value of the metric. + * @member {number} [minimum] The min value of the metric. + * @member {date} [timestamp] The metric timestamp (ISO-8601 format). + * @member {number} [total] The total value of the metric. + */ +export interface MetricValue { + readonly count?: number; + readonly average?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly timestamp?: Date; + readonly total?: number; +} + +/** + * @class + * Initializes a new instance of the MetricName class. + * @constructor + * A database metric name. + * + * @member {string} [value] The name of the database metric. + * @member {string} [localizedValue] The friendly name of the database metric. + */ +export interface MetricName { + readonly value?: string; + readonly localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the Metric class. + * @constructor + * Database metrics. + * + * @member {date} [startTime] The start time for the metric (ISO-8601 format). + * @member {date} [endTime] The end time for the metric (ISO-8601 format). + * @member {string} [timeGrain] The time step to be used to summarize the + * metric values. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'count', 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {array} [metricValues] The metric values for the specified time + * window and timestep. + */ +export interface Metric { + readonly startTime?: Date; + readonly endTime?: Date; + readonly timeGrain?: string; + readonly unit?: string; + readonly name?: MetricName; + readonly metricValues?: MetricValue[]; +} + +/** + * @class + * Initializes a new instance of the MetricAvailability class. + * @constructor + * A metric availability value. + * + * @member {string} [retention] The length of retention for the database + * metric. + * @member {string} [timeGrain] The granularity of the database metric. + */ +export interface MetricAvailability { + readonly retention?: string; + readonly timeGrain?: string; +} + +/** + * @class + * Initializes a new instance of the MetricDefinition class. + * @constructor + * A database metric definition. + * + * @member {object} [name] The name information for the metric. + * @member {string} [name.value] The name of the database metric. + * @member {string} [name.localizedValue] The friendly name of the database + * metric. + * @member {string} [primaryAggregationType] The primary aggregation type + * defining how metric values are displayed. Possible values include: 'None', + * 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + * @member {string} [resourceUri] The resource uri of the database. + * @member {string} [unit] The unit of the metric. Possible values include: + * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + * @member {array} [metricAvailabilities] The list of database metric + * availabities for the metric. + */ +export interface MetricDefinition { + readonly name?: MetricName; + readonly primaryAggregationType?: string; + readonly resourceUri?: string; + readonly unit?: string; + readonly metricAvailabilities?: MetricAvailability[]; +} + +/** + * @class + * Initializes a new instance of the RecommendedElasticPoolMetric class. + * @constructor + * Represents recommended elastic pool metric. + * + * @member {date} [dateTime] The time of metric (ISO8601 format). + * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). + * See + * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ + * @member {number} [sizeGB] Gets or sets size in gigabytes. + */ +export interface RecommendedElasticPoolMetric { + dateTime?: Date; + dtu?: number; + sizeGB?: number; +} + +/** + * @class + * Initializes a new instance of the RecommendedElasticPool class. + * @constructor + * Represents a recommented elastic pool. + * + * @member {string} [databaseEdition] The edition of the recommended elastic + * pool. The ElasticPoolEdition enumeration contains all the valid editions. + * Possible values include: 'Basic', 'Standard', 'Premium' + * @member {number} [dtu] The DTU for the recommended elastic pool. + * @member {number} [databaseDtuMin] The minimum DTU for the database. + * @member {number} [databaseDtuMax] The maximum DTU for the database. + * @member {number} [storageMB] Gets storage size in megabytes. + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 + * format). + * @member {number} [maxObservedDtu] Gets maximum observed DTU. + * @member {number} [maxObservedStorageMB] Gets maximum observed storage in + * megabytes. + * @member {array} [databases] The list of databases in this pool. Expanded + * property + * @member {array} [metrics] The list of databases housed in the server. + * Expanded property + */ +export interface RecommendedElasticPool extends ProxyResource { + readonly databaseEdition?: string; + dtu?: number; + databaseDtuMin?: number; + databaseDtuMax?: number; + storageMB?: number; + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly maxObservedDtu?: number; + readonly maxObservedStorageMB?: number; + readonly databases?: TrackedResource[]; + readonly metrics?: RecommendedElasticPoolMetric[]; +} + +/** + * @class + * Initializes a new instance of the ReplicationLink class. + * @constructor + * Represents a database replication link. + * + * @member {string} [location] Location of the server that contains this + * firewall rule. + * @member {boolean} [isTerminationAllowed] Legacy value indicating whether + * termination is allowed. Currently always returns true. + * @member {string} [replicationMode] Replication mode of this replication + * link. + * @member {string} [partnerServer] The name of the server hosting the partner + * database. + * @member {string} [partnerDatabase] The name of the partner database. + * @member {string} [partnerLocation] The Azure Region of the partner database. + * @member {string} [role] The role of the database in the replication link. + * Possible values include: 'Primary', 'Secondary', 'NonReadableSecondary', + * 'Source', 'Copy' + * @member {string} [partnerRole] The role of the partner database in the + * replication link. Possible values include: 'Primary', 'Secondary', + * 'NonReadableSecondary', 'Source', 'Copy' + * @member {date} [startTime] The start time for the replication link. + * @member {number} [percentComplete] The percentage of seeding complete for + * the replication link. + * @member {string} [replicationState] The replication state for the + * replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + * 'SUSPENDED' + */ +export interface ReplicationLink extends ProxyResource { + readonly location?: string; + readonly isTerminationAllowed?: boolean; + readonly replicationMode?: string; + readonly partnerServer?: string; + readonly partnerDatabase?: string; + readonly partnerLocation?: string; + readonly role?: string; + readonly partnerRole?: string; + readonly startTime?: Date; + readonly percentComplete?: number; + readonly replicationState?: string; +} + +/** + * @class + * Initializes a new instance of the ServerAzureADAdministrator class. + * @constructor + * An server Active Directory Administrator. + * + * @member {string} login The server administrator login value. + * @member {uuid} sid The server administrator Sid (Secure ID). + * @member {uuid} tenantId The server Active Directory Administrator tenant id. + */ +export interface ServerAzureADAdministrator extends ProxyResource { + login: string; + sid: string; + tenantId: string; +} + +/** + * @class + * Initializes a new instance of the ServerCommunicationLink class. + * @constructor + * Server communication link. + * + * @member {string} [state] The state. + * @member {string} partnerServer The name of the partner server. + * @member {string} [location] Communication link location. + * @member {string} [kind] Communication link kind. This property is used for + * Azure Portal metadata. + */ +export interface ServerCommunicationLink extends ProxyResource { + readonly state?: string; + partnerServer: string; + readonly location?: string; + readonly kind?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceObjective class. + * @constructor + * Represents a database service objective. + * + * @member {string} [serviceObjectiveName] The name for the service objective. + * @member {boolean} [isDefault] Gets whether the service level objective is + * the default service objective. + * @member {boolean} [isSystem] Gets whether the service level objective is a + * system service objective. + * @member {string} [description] The description for the service level + * objective. + * @member {boolean} [enabled] Gets whether the service level objective is + * enabled. + */ +export interface ServiceObjective extends ProxyResource { + readonly serviceObjectiveName?: string; + readonly isDefault?: boolean; + readonly isSystem?: boolean; + readonly description?: string; + readonly enabled?: boolean; } /** * @class - * Initializes a new instance of the TransparentDataEncryption class. + * Initializes a new instance of the ElasticPoolActivity class. * @constructor - * Represents a database transparent data encryption configuration. + * Represents the activity on an elastic pool. * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database transparent data - * encryption. Possible values include: 'Enabled', 'Disabled' + * @member {string} [location] The geo-location where the resource lives + * @member {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 TransparentDataEncryption extends ProxyResource { - readonly location?: string; - status?: string; +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; } /** @@ -544,123 +887,27 @@ export interface RecommendedIndex extends ProxyResource { /** * @class - * Initializes a new instance of the Database class. + * Initializes a new instance of the TransparentDataEncryption class. * @constructor - * Represents a database. - * - * @member {string} [kind] Kind of database. This is metadata used for the - * Azure portal experience. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * Represents a database transparent data encryption configuration. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @member {string} [location] Resource location. + * @member {string} [status] The status of the database transparent data + * encryption. Possible values include: 'Enabled', 'Disabled' + */ +export interface TransparentDataEncryption extends ProxyResource { + readonly location?: string; + status?: string; +} + +/** + * @class + * Initializes a new instance of the SloUsageMetric class. + * @constructor + * A Slo Usage Metric. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'System', 'System0', 'System1', + * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO + * usage metric. Possible values include: 'System', 'System0', 'System1', * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', @@ -669,244 +916,84 @@ export interface RecommendedIndex extends ProxyResource { * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' - * @member {boolean} [zoneRedundant] Whether or not this database is zone - * redundant, which means the replicas of this database will be spread across - * multiple availability zones. + * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for SLO + * usage metric. + * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO + * usage metric. */ -export interface Database extends TrackedResource { - readonly kind?: string; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; +export interface SloUsageMetric { readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; - zoneRedundant?: boolean; + readonly serviceLevelObjectiveId?: string; + readonly inRangeTimeRatio?: number; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the ServiceTierAdvisor class. * @constructor - * Represents a database update. + * Represents a Service Tier Advisor. * - * @member {object} [tags] Resource tags. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 + * @member {date} [observationPeriodStart] The observation period start + * (ISO8601 format). + * @member {date} [observationPeriodEnd] The observation period start (ISO8601 * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'System', 'System0', 'System1', - * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', 'Free', - * 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', 'P1', 'P2', - * 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', 'PRS6', 'DW100', - * 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', 'DW1200', 'DW1000c', - * 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', - * 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', 'DW15000c', - * 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', 'DS600', 'DS1000', - * 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' - * @member {boolean} [zoneRedundant] Whether or not this database is zone - * redundant, which means the replicas of this database will be spread across - * multiple availability zones. + * @member {number} [activeTimeRatio] The activeTimeRatio for service tier + * advisor. + * @member {number} [minDtu] Gets or sets minDtu for service tier advisor. + * @member {number} [avgDtu] Gets or sets avgDtu for service tier advisor. + * @member {number} [maxDtu] Gets or sets maxDtu for service tier advisor. + * @member {number} [maxSizeInGB] Gets or sets maxSizeInGB for service tier + * advisor. + * @member {array} [serviceLevelObjectiveUsageMetrics] Gets or sets + * serviceLevelObjectiveUsageMetrics for the service tier advisor. + * @member {string} [currentServiceLevelObjective] Gets or sets + * currentServiceLevelObjective for service tier advisor. + * @member {uuid} [currentServiceLevelObjectiveId] Gets or sets + * currentServiceLevelObjectiveId for service tier advisor. + * @member {string} [usageBasedRecommendationServiceLevelObjective] Gets or + * sets usageBasedRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [usageBasedRecommendationServiceLevelObjectiveId] Gets or + * sets usageBasedRecommendationServiceLevelObjectiveId for service tier + * advisor. + * @member {string} [databaseSizeBasedRecommendationServiceLevelObjective] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [databaseSizeBasedRecommendationServiceLevelObjectiveId] Gets + * or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [disasterPlanBasedRecommendationServiceLevelObjective] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjective for service + * tier advisor. + * @member {uuid} [disasterPlanBasedRecommendationServiceLevelObjectiveId] Gets + * or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service + * tier advisor. + * @member {string} [overallRecommendationServiceLevelObjective] Gets or sets + * overallRecommendationServiceLevelObjective for service tier advisor. + * @member {uuid} [overallRecommendationServiceLevelObjectiveId] Gets or sets + * overallRecommendationServiceLevelObjectiveId for service tier advisor. + * @member {number} [confidence] Gets or sets confidence for service tier + * advisor. */ -export interface DatabaseUpdate extends Resource { - tags?: { [propertyName: string]: string }; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; - zoneRedundant?: boolean; +export interface ServiceTierAdvisor extends ProxyResource { + readonly observationPeriodStart?: Date; + readonly observationPeriodEnd?: Date; + readonly activeTimeRatio?: number; + readonly minDtu?: number; + readonly avgDtu?: number; + readonly maxDtu?: number; + readonly maxSizeInGB?: number; + readonly serviceLevelObjectiveUsageMetrics?: SloUsageMetric[]; + readonly currentServiceLevelObjective?: string; + readonly currentServiceLevelObjectiveId?: string; + readonly usageBasedRecommendationServiceLevelObjective?: string; + readonly usageBasedRecommendationServiceLevelObjectiveId?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjective?: string; + readonly databaseSizeBasedRecommendationServiceLevelObjectiveId?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjective?: string; + readonly disasterPlanBasedRecommendationServiceLevelObjectiveId?: string; + readonly overallRecommendationServiceLevelObjective?: string; + readonly overallRecommendationServiceLevelObjectiveId?: string; + readonly confidence?: number; } /** @@ -929,1728 +1016,1841 @@ export interface TransparentDataEncryptionActivity extends ProxyResource { /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the ServerUsage class. * @constructor - * Represents the activity on an elastic pool. + * Represents server metrics. * - * @member {string} [location] The geo-location where the resource lives - * @member {string} [databaseName] The database name. - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {string} [requestedElasticPoolName] The name for the elastic pool - * the database is moving into if available. - * @member {string} [currentElasticPoolName] The name of the current elastic - * pool the database is in if available. - * @member {string} [currentServiceObjective] The name of the current service - * objective if available. - * @member {string} [requestedServiceObjective] The name of the requested - * service objective if available. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. + * @member {string} [name] Name of the server usage metric. + * @member {string} [resourceName] The name of the resource. + * @member {string} [displayName] The metric display name. + * @member {number} [currentValue] The current value of the metric. + * @member {number} [limit] The current limit of the metric. + * @member {string} [unit] The units of the metric. + * @member {date} [nextResetTime] The next reset time for the metric (ISO8601 + * format). */ -export interface ElasticPoolDatabaseActivity extends ProxyResource { - location?: string; - readonly databaseName?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedElasticPoolName?: string; - readonly currentElasticPoolName?: string; - readonly currentServiceObjective?: string; - readonly requestedServiceObjective?: string; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; +export interface ServerUsage { + readonly name?: string; + readonly resourceName?: string; + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; + readonly nextResetTime?: Date; } /** * @class - * Initializes a new instance of the ElasticPoolActivity class. + * Initializes a new instance of the DatabaseUsage class. * @constructor - * Represents the activity on an elastic pool. + * The database usages. * - * @member {string} [location] The geo-location where the resource lives - * @member {date} [endTime] The time the operation finished (ISO8601 format). - * @member {number} [errorCode] The error code if available. - * @member {string} [errorMessage] The error message if available. - * @member {number} [errorSeverity] The error severity if available. - * @member {string} [operation] The operation name. - * @member {uuid} [operationId] The unique operation ID. - * @member {number} [percentComplete] The percentage complete if available. - * @member {number} [requestedDatabaseDtuMax] The requested max DTU per - * database if available. - * @member {number} [requestedDatabaseDtuMin] The requested min DTU per - * database if available. - * @member {number} [requestedDtu] The requested DTU for the pool if available. - * @member {string} [requestedElasticPoolName] The requested name for the - * elastic pool if available. - * @member {number} [requestedStorageLimitInGB] The requested storage limit for - * the pool in GB if available. - * @member {string} [elasticPoolName] The name of the elastic pool. - * @member {string} [serverName] The name of the server the elastic pool is in. - * @member {date} [startTime] The time the operation started (ISO8601 format). - * @member {string} [state] The current state of the operation. - * @member {number} [requestedStorageLimitInMB] The requested storage limit in - * MB. - * @member {number} [requestedDatabaseDtuGuarantee] The requested per database - * DTU guarantee. - * @member {number} [requestedDatabaseDtuCap] The requested per database DTU - * cap. - * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. + * @member {string} [name] The name of the usage metric. + * @member {string} [resourceName] The name of the resource. + * @member {string} [displayName] The usage metric display name. + * @member {number} [currentValue] The current value of the usage metric. + * @member {number} [limit] The current limit of the usage metric. + * @member {string} [unit] The units of the usage metric. + * @member {date} [nextResetTime] The next reset time for the usage metric + * (ISO8601 format). */ -export interface ElasticPoolActivity extends ProxyResource { - location?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; - readonly operation?: string; - readonly operationId?: string; - readonly percentComplete?: number; - readonly requestedDatabaseDtuMax?: number; - readonly requestedDatabaseDtuMin?: number; - readonly requestedDtu?: number; - readonly requestedElasticPoolName?: string; - readonly requestedStorageLimitInGB?: number; - readonly elasticPoolName?: string; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly requestedStorageLimitInMB?: number; - readonly requestedDatabaseDtuGuarantee?: number; - readonly requestedDatabaseDtuCap?: number; - readonly requestedDtuGuarantee?: number; +export interface DatabaseUsage { + readonly name?: string; + readonly resourceName?: string; + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; + readonly nextResetTime?: Date; } /** * @class - * Initializes a new instance of the DatabaseSecurityAlertPolicy class. + * Initializes a new instance of the DatabaseBlobAuditingPolicy class. * @constructor - * Contains information about a database Threat Detection policy. + * A database blob auditing 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' + * 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. + * 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 DataMaskingPolicy extends ProxyResource { - dataMaskingState: string; - exemptPrincipals?: string; - readonly applicationPrincipals?: string; - readonly maskingLevel?: string; - readonly location?: string; +export interface DatabaseBlobAuditingPolicy extends ProxyResource { readonly kind?: string; + state: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + auditActionsAndGroups?: string[]; + storageAccountSubscriptionId?: string; + isStorageSecondaryKeyInUse?: boolean; } /** * @class - * Initializes a new instance of the DataMaskingRule class. + * Initializes a new instance of the AutomaticTuningOptions class. * @constructor - * Represents a database data masking rule. + * Automatic tuning properties for individual advisors. * - * @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} [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 DataMaskingRule extends ProxyResource { - readonly dataMaskingRuleId?: string; - aliasName?: string; - ruleState?: string; - schemaName: string; - tableName: string; - columnName: string; - maskingFunction: string; - numberFrom?: string; - numberTo?: string; - prefixSize?: string; - suffixSize?: string; - replacementString?: string; - readonly location?: string; - readonly kind?: string; +export interface AutomaticTuningOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the ElasticPool class. + * Initializes a new instance of the DatabaseAutomaticTuning class. * @constructor - * Represents a database elastic pool. + * Database-level Automatic Tuning. * - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic pool - * is zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. - * @member {string} [kind] Kind of elastic pool. This is metadata used for the - * Azure portal experience. + * @member {string} [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 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 DatabaseAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningOptions }; } /** * @class - * Initializes a new instance of the ElasticPoolUpdate class. + * Initializes a new instance of the EncryptionProtector class. * @constructor - * Represents an elastic pool update. + * The server encryption protector. * - * @member {object} [tags] Resource tags. - * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 - * format). - * @member {string} [state] The state of the elastic pool. Possible values - * include: 'Creating', 'Ready', 'Disabled' - * @member {string} [edition] The edition of the elastic pool. Possible values - * include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The total shared DTU for the database elastic pool. - * @member {number} [databaseDtuMax] The maximum DTU any one database can - * consume. - * @member {number} [databaseDtuMin] The minimum DTU all databases are - * guaranteed. - * @member {number} [storageMB] Gets storage limit for the database elastic - * pool in MB. - * @member {boolean} [zoneRedundant] Whether or not this database elastic pool - * is zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @member {string} [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 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 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 FirewallRule class. + * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. * @constructor - * Represents a server firewall rule. + * Read-write endpoint of the failover group instance. * - * @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} 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 FirewallRule extends ProxyResource { - readonly kind?: string; - readonly location?: string; - startIpAddress: string; - endIpAddress: string; +export interface FailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; } /** * @class - * Initializes a new instance of the GeoBackupPolicy class. + * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. * @constructor - * A database geo backup policy. + * Read-only endpoint of the failover group instance. * - * @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} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' */ -export interface GeoBackupPolicy extends ProxyResource { - state: string; - readonly storageType?: string; - readonly kind?: string; - readonly location?: string; +export interface FailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; } /** * @class - * Initializes a new instance of the ImportExtensionRequest class. + * Initializes a new instance of the PartnerInfo class. * @constructor - * Import database parameters. + * Partner server information for the failover group. * - * @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} 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 ImportExtensionRequest { - name?: string; - type?: string; - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface PartnerInfo { + id: string; + readonly location?: string; + readonly replicationRole?: 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. + * @class + * Initializes a new instance of the FailoverGroup class. + * @constructor + * A failover group. + * + * @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 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 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 ExportRequest class. + * Initializes a new instance of the FailoverGroupUpdate class. * @constructor - * Export database parameters. + * A failover group update request. * - * @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 {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 ExportRequest { - storageKeyType: string; - storageKey: string; - storageUri: string; - administratorLogin: string; - administratorLoginPassword: string; - authenticationType?: string; +export interface FailoverGroupUpdate { + readWriteEndpoint?: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + databases?: string[]; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the ImportRequest class. + * Initializes a new instance of the OperationDisplay class. * @constructor - * Import database parameters. + * Display metadata associated with the operation. * - * @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} [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 ImportRequest extends ExportRequest { - databaseName: string; - edition: string; - serviceObjectiveName: string; - maxSizeBytes: string; +export interface OperationDisplay { + readonly provider?: string; + readonly resource?: string; + readonly operation?: string; + readonly description?: string; } /** * @class - * Initializes a new instance of the MetricValue class. + * Initializes a new instance of the Operation class. * @constructor - * Represents database metrics. + * SQL REST API operation definition. * - * @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} [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 MetricValue { - readonly count?: number; - readonly average?: number; - readonly maximum?: number; - readonly minimum?: number; - readonly timestamp?: Date; - readonly total?: number; +export interface Operation { + readonly name?: string; + readonly display?: OperationDisplay; + readonly origin?: string; + readonly properties?: { [propertyName: string]: any }; } /** * @class - * Initializes a new instance of the MetricName class. + * Initializes a new instance of the ServerKey class. * @constructor - * A database metric name. + * A server key. * - * @member {string} [value] The name of the database metric. - * @member {string} [localizedValue] The friendly name of the database metric. + * @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 MetricName { - readonly value?: string; - readonly localizedValue?: 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 Metric class. + * Initializes a new instance of the ResourceIdentity class. * @constructor - * Database metrics. + * Azure Active Directory identity configuration for a resource. * - * @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 {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 Metric { - readonly startTime?: Date; - readonly endTime?: Date; - readonly timeGrain?: string; - readonly unit?: string; - readonly name?: MetricName; - readonly metricValues?: MetricValue[]; +export interface ResourceIdentity { + readonly principalId?: string; + type?: string; + readonly tenantId?: string; } /** * @class - * Initializes a new instance of the MetricAvailability class. + * Initializes a new instance of the Server class. * @constructor - * A metric availability value. + * An Azure SQL Database server. * - * @member {string} [retention] The length of retention for the database - * metric. - * @member {string} [timeGrain] The granularity of the database metric. + * @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 MetricAvailability { - readonly retention?: string; - readonly timeGrain?: string; +export interface Server extends TrackedResource { + identity?: ResourceIdentity; + readonly kind?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + version?: string; + readonly state?: string; + readonly fullyQualifiedDomainName?: string; } /** * @class - * Initializes a new instance of the MetricDefinition class. + * Initializes a new instance of the ServerUpdate class. * @constructor - * A database metric definition. + * An update request for an Azure SQL Database server. * - * @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} [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 MetricDefinition { - readonly name?: MetricName; - readonly primaryAggregationType?: string; - readonly resourceUri?: string; - readonly unit?: string; - readonly metricAvailabilities?: MetricAvailability[]; +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 RecommendedElasticPoolMetric class. + * Initializes a new instance of the SyncAgent class. * @constructor - * Represents recommended elastic pool metric. + * An Azure SQL Database sync agent. * - * @member {date} [dateTime] The time of metric (ISO8601 format). - * @member {number} [dtu] Gets or sets the DTUs (Database Transaction Units). - * See - * https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - * @member {number} [sizeGB] Gets or sets size in gigabytes. + * @member {string} [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 RecommendedElasticPoolMetric { - dateTime?: Date; - dtu?: number; - sizeGB?: number; +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 RecommendedElasticPool class. + * Initializes a new instance of the SyncAgentKeyProperties class. * @constructor - * Represents a recommented elastic pool. + * Properties of an Azure SQL Database sync agent key. * - * @member {string} [databaseEdition] The edition of the recommended elastic - * pool. The ElasticPoolEdition enumeration contains all the valid editions. - * Possible values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The DTU for the recommended elastic pool. - * @member {number} [databaseDtuMin] The minimum DTU for the database. - * @member {number} [databaseDtuMax] The maximum DTU for the database. - * @member {number} [storageMB] Gets storage size in megabytes. - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [maxObservedDtu] Gets maximum observed DTU. - * @member {number} [maxObservedStorageMB] Gets maximum observed storage in - * megabytes. - * @member {array} [databases] The list of databases in this pool. Expanded - * property - * @member {array} [metrics] The list of databases housed in the server. - * Expanded property + * @member {string} [syncAgentKey] Key of sync agent. */ -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 SyncAgentKeyProperties { + readonly syncAgentKey?: string; } /** * @class - * Initializes a new instance of the ReplicationLink class. + * Initializes a new instance of the SyncAgentLinkedDatabase class. * @constructor - * Represents a database replication link. + * An Azure SQL Database sync agent linked 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 + * @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} [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} [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 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 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 ServerAzureADAdministrator class. + * Initializes a new instance of the SyncDatabaseIdProperties class. * @constructor - * An server Active Directory Administrator. + * Properties of the sync database id. * - * @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} [id] ARM resource id of sync database. */ -export interface ServerAzureADAdministrator extends ProxyResource { - login: string; - sid: string; - tenantId: string; +export interface SyncDatabaseIdProperties { + readonly id?: string; } /** * @class - * Initializes a new instance of the ServerCommunicationLink class. + * Initializes a new instance of the SyncFullSchemaTableColumn class. * @constructor - * Server communication link. + * Properties of the column in the table of database full schema. * - * @member {string} [state] The state. - * @member {string} partnerServer The name of the partner server. - * @member {string} [location] Communication link location. - * @member {string} [kind] Communication link kind. This property is used for - * Azure Portal metadata. + * @member {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 ServerCommunicationLink extends ProxyResource { - readonly state?: string; - partnerServer: string; - readonly location?: string; - readonly kind?: string; +export interface SyncFullSchemaTableColumn { + readonly dataSize?: string; + readonly dataType?: string; + readonly errorId?: string; + readonly hasError?: boolean; + readonly isPrimaryKey?: boolean; + readonly name?: string; + readonly quotedName?: string; } /** * @class - * Initializes a new instance of the ServiceObjective class. + * Initializes a new instance of the SyncFullSchemaTable class. * @constructor - * Represents a database service objective. + * Properties of the table in the database full schema. * - * @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 {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 ServiceObjective extends ProxyResource { - readonly serviceObjectiveName?: string; - readonly isDefault?: boolean; - readonly isSystem?: boolean; - readonly description?: string; - readonly enabled?: boolean; +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 ServerUsage class. + * Initializes a new instance of the SyncFullSchemaProperties class. * @constructor - * Represents server metrics. - * - * @member {string} [name] Name of the server usage metric. - * @member {string} [resourceName] The name of the resource. - * @member {string} [displayName] The metric display name. - * @member {number} [currentValue] The current value of the metric. - * @member {number} [limit] The current limit of the metric. - * @member {string} [unit] The units of the metric. - * @member {date} [nextResetTime] The next reset time for the metric (ISO8601 - * format). - */ -export interface ServerUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; + * Properties of the database full schema. + * + * @member {array} [tables] List of tables in the database full schema. + * @member {date} [lastUpdateTime] Last update time of the database schema. + */ +export interface SyncFullSchemaProperties { + readonly tables?: SyncFullSchemaTable[]; + readonly lastUpdateTime?: Date; } /** * @class - * Initializes a new instance of the DatabaseUsage class. + * Initializes a new instance of the SyncGroupLogProperties class. * @constructor - * The database usages. + * Properties of an Azure SQL Database sync group log. * - * @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 {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 DatabaseUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; +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 DatabaseBlobAuditingPolicy class. + * Initializes a new instance of the SyncGroupSchemaTableColumn class. * @constructor - * A database blob auditing policy. + * Properties of column in sync group table. * - * @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} [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 DatabaseBlobAuditingPolicy extends ProxyResource { - readonly kind?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; +export interface SyncGroupSchemaTableColumn { + quotedName?: string; + dataSize?: string; + dataType?: string; } /** * @class - * Initializes a new instance of the AutomaticTuningOptions class. + * Initializes a new instance of the SyncGroupSchemaTable class. * @constructor - * Automatic tuning properties for individual advisors. + * Properties of table in sync group schema. * - * @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 {array} [columns] List of columns in sync group schema. + * @member {string} [quotedName] Quoted name of sync group schema table. */ -export interface AutomaticTuningOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: string; +export interface SyncGroupSchemaTable { + columns?: SyncGroupSchemaTableColumn[]; + quotedName?: string; } /** * @class - * Initializes a new instance of the DatabaseAutomaticTuning class. + * Initializes a new instance of the SyncGroupSchema class. * @constructor - * Database-level Automatic Tuning. + * Properties of sync group schema. * - * @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 {array} [tables] List of tables in sync group schema. + * @member {string} [masterSyncMemberName] Name of master sync member where the + * schema is from. */ -export interface DatabaseAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningOptions }; +export interface SyncGroupSchema { + tables?: SyncGroupSchemaTable[]; + masterSyncMemberName?: string; } /** * @class - * Initializes a new instance of the EncryptionProtector class. + * Initializes a new instance of the SyncGroup class. * @constructor - * The server encryption protector. + * An Azure SQL Database sync group. * - * @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 {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 EncryptionProtector extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyName?: string; - serverKeyType: string; - readonly uri?: string; - readonly thumbprint?: 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 FailoverGroupReadWriteEndpoint class. + * Initializes a new instance of the SyncMember class. * @constructor - * Read-write endpoint of the failover group instance. + * An Azure SQL Database sync member. * - * @member {string} failoverPolicy Failover policy of the read-write endpoint - * for the failover group. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. Possible values include: - * 'Manual', 'Automatic' - * @member {number} [failoverWithDataLossGracePeriodMinutes] Grace period - * before failover with data loss is attempted for the read-write endpoint. If - * failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is - * required. + * @member {string} [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 FailoverGroupReadWriteEndpoint { - failoverPolicy: string; - failoverWithDataLossGracePeriodMinutes?: number; +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 FailoverGroupReadOnlyEndpoint class. + * Initializes a new instance of the SubscriptionUsage class. * @constructor - * Read-only endpoint of the failover group instance. + * Usage Metric of a Subscription in a Location. * - * @member {string} [failoverPolicy] Failover policy of the read-only endpoint - * for the failover group. Possible values include: 'Disabled', 'Enabled' + * @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 FailoverGroupReadOnlyEndpoint { - failoverPolicy?: string; +export interface SubscriptionUsage extends ProxyResource { + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the PartnerInfo class. + * Initializes a new instance of the VirtualNetworkRule class. * @constructor - * Partner server information for the failover group. + * A virtual network rule. * - * @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} 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 PartnerInfo { - id: string; - readonly location?: string; - readonly replicationRole?: string; +export interface VirtualNetworkRule extends ProxyResource { + virtualNetworkSubnetId: string; + ignoreMissingVnetServiceEndpoint?: boolean; + readonly state?: string; } /** * @class - * Initializes a new instance of the FailoverGroup class. + * Initializes a new instance of the LongTermRetentionBackup class. * @constructor - * A failover group. + * A long term retention backup. * - * @member {string} [location] Resource location. - * @member {object} [tags] Resource tags. - * @member {object} readWriteEndpoint Read-write endpoint of the failover group - * instance. - * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the - * read-write endpoint for the failover group. If failoverPolicy is Automatic - * then failoverWithDataLossGracePeriodMinutes is required. Possible values - * include: 'Manual', 'Automatic' - * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] - * Grace period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group - * instance. - * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the - * read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * @member {string} [replicationRole] Local replication role of the failover - * group instance. Possible values include: 'Primary', 'Secondary' - * @member {string} [replicationState] Replication state of the failover group - * instance. - * @member {array} partnerServers List of partner server information for the - * failover group. - * @member {array} [databases] List of databases in the failover group. + * @member {string} [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 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 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 FailoverGroupUpdate class. + * Initializes a new instance of the BackupLongTermRetentionPolicy class. * @constructor - * A failover group update request. + * A long term retention policy. * - * @member {object} [readWriteEndpoint] Read-write endpoint of the failover - * group instance. - * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the - * read-write endpoint for the failover group. If failoverPolicy is Automatic - * then failoverWithDataLossGracePeriodMinutes is required. Possible values - * include: 'Manual', 'Automatic' - * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] - * Grace period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group - * instance. - * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the - * read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' - * @member {array} [databases] List of databases in the failover group. - * @member {object} [tags] Resource tags. + * @member {string} [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 FailoverGroupUpdate { - readWriteEndpoint?: FailoverGroupReadWriteEndpoint; - readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; - databases?: 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 OperationDisplay class. + * Initializes a new instance of the AutomaticTuningServerOptions class. * @constructor - * Display metadata associated with the operation. + * Automatic tuning properties for individual advisors. * - * @member {string} [provider] The localized friendly form of the resource - * provider name. - * @member {string} [resource] The localized friendly form of the resource type - * related to this action/operation. - * @member {string} [operation] The localized friendly name for the operation. - * @member {string} [description] The localized friendly description for the - * operation. + * @member {string} [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 OperationDisplay { - readonly provider?: string; - readonly resource?: string; - readonly operation?: string; - readonly description?: string; +export interface AutomaticTuningServerOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the Operation class. + * Initializes a new instance of the ServerAutomaticTuning class. * @constructor - * SQL REST API operation definition. + * Server-level Automatic Tuning. * - * @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} [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 Operation { - readonly name?: string; - readonly display?: OperationDisplay; - readonly origin?: string; - readonly properties?: { [propertyName: string]: any }; +export interface ServerAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningServerOptions }; } /** * @class - * Initializes a new instance of the ServerKey class. + * Initializes a new instance of the ServerDnsAlias class. * @constructor - * A server key. + * A server DNS alias. * - * @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} [azureDnsRecord] The fully qualified DNS record for alias */ -export interface ServerKey extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyType: string; - uri?: string; - thumbprint?: string; - creationDate?: Date; +export interface ServerDnsAlias extends ProxyResource { + readonly azureDnsRecord?: string; } /** * @class - * Initializes a new instance of the ResourceIdentity class. + * Initializes a new instance of the ServerDnsAliasAcquisition class. * @constructor - * Azure Active Directory identity configuration for a resource. + * A server DNS alias acquisition request. * - * @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} [oldServerDnsAliasId] The id of the server alias that will + * be acquired to point to this server instead. */ -export interface ResourceIdentity { - readonly principalId?: string; - type?: string; - readonly tenantId?: string; +export interface ServerDnsAliasAcquisition { + oldServerDnsAliasId?: string; } /** * @class - * Initializes a new instance of the Server class. + * Initializes a new instance of the RestorePoint class. * @constructor - * An Azure SQL Database server. + * Database restore points. * - * @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} [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 Server extends TrackedResource { - identity?: ResourceIdentity; - readonly kind?: string; - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: 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 ServerUpdate class. - * @constructor - * An update request for an Azure SQL Database server. - * - * @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. +/** + * @class + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. + * @constructor + * Contains the information necessary to perform a create database restore + * point operation. + * + * @member {string} restorePointLabel The restore point label to apply */ -export interface ServerUpdate { - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: string; - tags?: { [propertyName: string]: string }; +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; } /** * @class - * Initializes a new instance of the SyncAgent class. + * Initializes a new instance of the DatabaseOperation class. * @constructor - * An Azure SQL Database sync agent. + * A database operation. * - * @member {string} [syncAgentName] Name of the sync agent. - * @member {string} [syncDatabaseId] ARM resource id of the sync database in - * the sync agent. - * @member {date} [lastAliveTime] Last alive time of the sync agent. - * @member {string} [state] State of the sync agent. Possible values include: - * 'Online', 'Offline', 'NeverConnected' - * @member {boolean} [isUpToDate] If the sync agent version is up to date. - * @member {date} [expiryTime] Expiration time of the sync agent version. - * @member {string} [version] Version of the sync agent. + * @member {string} [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 SyncAgent extends ProxyResource { - readonly syncAgentName?: string; - syncDatabaseId?: string; - readonly lastAliveTime?: 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 isUpToDate?: boolean; - readonly expiryTime?: Date; - readonly version?: string; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; } /** * @class - * Initializes a new instance of the SyncAgentKeyProperties class. + * Initializes a new instance of the ElasticPoolOperation class. * @constructor - * Properties of an Azure SQL Database sync agent key. + * A elastic pool operation. * - * @member {string} [syncAgentKey] Key of sync agent. + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ -export interface SyncAgentKeyProperties { - readonly syncAgentKey?: 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 SyncAgentLinkedDatabase class. + * Initializes a new instance of the MaxSizeCapability class. * @constructor - * An Azure SQL Database sync agent linked database. + * The maximum size capability. * - * @member {string} [databaseType] Type of the sync agent linked database. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * @member {string} [databaseId] Id of the sync agent linked database. - * @member {string} [description] Description of the sync agent linked - * database. - * @member {string} [serverName] Server name of the sync agent linked database. - * @member {string} [databaseName] Database name of the sync agent linked - * database. - * @member {string} [userName] User name of the sync agent linked database. + * @member {number} [limit] The 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 SyncAgentLinkedDatabase extends ProxyResource { - readonly databaseType?: string; - readonly databaseId?: string; - readonly description?: string; - readonly serverName?: string; - readonly databaseName?: string; - readonly userName?: string; +export interface MaxSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncDatabaseIdProperties class. + * Initializes a new instance of the LogSizeCapability class. * @constructor - * Properties of the sync database id. + * The log size capability. * - * @member {string} [id] ARM resource id of sync database. + * @member {number} [limit] The log size limit (see 'unit' for the units). + * @member {string} [unit] The units that the limit is expressed in. Possible + * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', + * 'Percent' */ -export interface SyncDatabaseIdProperties { - readonly id?: string; +export interface LogSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaTableColumn class. + * Initializes a new instance of the MaxSizeRangeCapability class. * @constructor - * Properties of the column in the table of database full schema. + * The maximum size range capability. * - * @member {string} [dataSize] Data size of the column. - * @member {string} [dataType] Data type of the column. - * @member {string} [errorId] Error id of the column. - * @member {boolean} [hasError] If there is error in the table. - * @member {boolean} [isPrimaryKey] If it is the primary key of the table. - * @member {string} [name] Name of the column. - * @member {string} [quotedName] Quoted name of the column. + * @member {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 SyncFullSchemaTableColumn { - readonly dataSize?: string; - readonly dataType?: string; - readonly errorId?: string; - readonly hasError?: boolean; - readonly isPrimaryKey?: boolean; - readonly name?: string; - readonly quotedName?: 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 SyncFullSchemaTable class. + * Initializes a new instance of the PerformanceLevelCapability class. * @constructor - * Properties of the table in the database full schema. + * The performance level capability. * - * @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 {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' */ -export interface SyncFullSchemaTable { - readonly columns?: SyncFullSchemaTableColumn[]; - readonly errorId?: string; - readonly hasError?: boolean; - readonly name?: string; - readonly quotedName?: string; +export interface PerformanceLevelCapability { + readonly value?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaProperties class. + * Initializes a new instance of the Sku class. * @constructor - * Properties of the database full schema. + * An ARM Resource SKU. * - * @member {array} [tables] List of tables in the database full schema. - * @member {date} [lastUpdateTime] Last update time of the database schema. + * @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 SyncFullSchemaProperties { - readonly tables?: SyncFullSchemaTable[]; - readonly lastUpdateTime?: Date; +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; } /** * @class - * Initializes a new instance of the SyncGroupLogProperties class. + * Initializes a new instance of the LicenseTypeCapability class. * @constructor - * Properties of an Azure SQL Database sync group log. + * The license type capability * - * @member {date} [timestamp] Timestamp of the sync group log. - * @member {string} [type] Type of the sync group log. Possible values include: - * 'All', 'Error', 'Warning', 'Success' - * @member {string} [source] Source of the sync group log. - * @member {string} [details] Details of the sync group log. - * @member {uuid} [tracingId] TracingId of the sync group log. - * @member {string} [operationStatus] OperationStatus of the sync group log. + * @member {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 SyncGroupLogProperties { - readonly timestamp?: Date; - readonly type?: string; - readonly source?: string; - readonly details?: string; - readonly tracingId?: string; - readonly operationStatus?: string; +export interface LicenseTypeCapability { + readonly name?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTableColumn class. + * Initializes a new instance of the ServiceObjectiveCapability class. * @constructor - * Properties of column in sync group table. + * The service objectives 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 {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 SyncGroupSchemaTableColumn { - quotedName?: string; - dataSize?: string; - dataType?: 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 SyncGroupSchemaTable class. + * Initializes a new instance of the EditionCapability class. * @constructor - * Properties of table in sync group schema. + * The edition capability. * - * @member {array} [columns] List of columns in sync group schema. - * @member {string} [quotedName] Quoted name of sync group schema table. + * @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 SyncGroupSchemaTable { - columns?: SyncGroupSchemaTableColumn[]; - quotedName?: string; +export interface EditionCapability { + readonly name?: string; + readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchema class. + * Initializes a new instance of the ElasticPoolPerDatabaseMinPerformanceLevelCapability class. * @constructor - * Properties of sync group schema. + * The minimum per-database performance level capability. * - * @member {array} [tables] List of tables in sync group schema. - * @member {string} [masterSyncMemberName] Name of master sync member where the - * schema is from. + * @member {number} [limit] The 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 SyncGroupSchema { - tables?: SyncGroupSchemaTable[]; - masterSyncMemberName?: string; +export interface ElasticPoolPerDatabaseMinPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroup class. + * Initializes a new instance of the ElasticPoolPerDatabaseMaxPerformanceLevelCapability class. * @constructor - * An Azure SQL Database sync group. + * The max per-database 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} [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 SyncGroup extends ProxyResource { - interval?: number; - readonly lastSyncTime?: Date; - conflictResolutionPolicy?: string; - syncDatabaseId?: string; - hubDatabaseUserName?: string; - hubDatabasePassword?: string; - readonly syncState?: string; - schema?: SyncGroupSchema; +export interface ElasticPoolPerDatabaseMaxPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly supportedPerDatabaseMinPerformanceLevels?: ElasticPoolPerDatabaseMinPerformanceLevelCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncMember class. + * Initializes a new instance of the ElasticPoolPerformanceLevelCapability class. * @constructor - * An Azure SQL Database sync member. + * The Elastic Pool performance level capability. * - * @member {string} [databaseType] Database type of the sync member. Possible - * values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * @member {string} [syncAgentId] ARM resource id of the sync agent in the sync - * member. - * @member {uuid} [sqlServerDatabaseId] SQL Server database id of the sync - * member. - * @member {string} [serverName] Server name of the member database in the sync - * member - * @member {string} [databaseName] Database name of the member database in the - * sync member. - * @member {string} [userName] User name of the member database in the sync - * member. - * @member {string} [password] Password of the member database in the sync - * member. - * @member {string} [syncDirection] Sync direction of the sync member. Possible - * values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' - * @member {string} [syncState] Sync state of the sync member. Possible values - * include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', - * 'DisabledTombstoneCleanup', 'DisabledBackupRestore', - * 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', - * 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', - * 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', - * 'ReprovisionFailed', 'UnReprovisioned' + * @member {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 SyncMember extends ProxyResource { - databaseType?: string; - syncAgentId?: string; - sqlServerDatabaseId?: string; - serverName?: string; - databaseName?: string; - userName?: string; - password?: string; - syncDirection?: string; - readonly syncState?: 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 SubscriptionUsage class. + * Initializes a new instance of the ElasticPoolEditionCapability class. * @constructor - * Usage Metric of a Subscription in a Location. + * The elastic pool edition capability. * - * @member {string} [displayName] User-readable name of the metric. - * @member {number} [currentValue] Current value of the metric. - * @member {number} [limit] Boundary value of the metric. - * @member {string} [unit] Unit of the metric. + * @member {string} [name] The 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 SubscriptionUsage extends ProxyResource { - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; +export interface ElasticPoolEditionCapability { + readonly name?: string; + readonly supportedElasticPoolPerformanceLevels?: ElasticPoolPerformanceLevelCapability[]; + readonly zoneRedundant?: boolean; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the VirtualNetworkRule class. + * Initializes a new instance of the ServerVersionCapability class. * @constructor - * A virtual network rule. + * The server capability * - * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual - * network subnet. - * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. - * @member {string} [state] Virtual Network Rule State. Possible values - * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + * @member {string} [name] The 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 VirtualNetworkRule extends ProxyResource { - virtualNetworkSubnetId: string; - ignoreMissingVnetServiceEndpoint?: boolean; - readonly state?: 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 LongTermRetentionBackup class. + * Initializes a new instance of the ManagedInstanceVcoresCapability class. * @constructor - * A long term retention backup. + * The managed instance virtual cores 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 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 LongTermRetentionBackup extends ProxyResource { - readonly serverName?: string; - readonly serverCreateTime?: Date; - readonly databaseName?: string; - readonly databaseDeletionTime?: Date; - readonly backupTime?: Date; - readonly backupExpirationTime?: Date; +export interface ManagedInstanceVcoresCapability { + readonly name?: string; + readonly value?: number; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the BackupLongTermRetentionPolicy class. + * Initializes a new instance of the ManagedInstanceFamilyCapability class. * @constructor - * A long term retention policy. + * The managed server family capability. * - * @member {string} [weeklyRetention] The weekly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {string} [monthlyRetention] The montly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {string} [yearlyRetention] The yearly retention policy for an LTR - * backup in an ISO 8601 format. - * @member {number} [weekOfYear] The week of year to take the yearly backup in - * an ISO 8601 format. + * @member {string} [name] 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 BackupLongTermRetentionPolicy extends ProxyResource { - weeklyRetention?: string; - monthlyRetention?: string; - yearlyRetention?: string; - weekOfYear?: number; +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 ResourceMoveDefinition class. + * Initializes a new instance of the ManagedInstanceEditionCapability class. * @constructor - * Contains the information necessary to perform a resource move (rename). + * The managed server capability * - * @member {string} id The target ID for the resource + * @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 ResourceMoveDefinition { - id: string; +export interface ManagedInstanceEditionCapability { + readonly name?: string; + readonly supportedFamilies?: ManagedInstanceFamilyCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the AutomaticTuningServerOptions class. + * Initializes a new instance of the ManagedInstanceVersionCapability class. * @constructor - * Automatic tuning properties for individual advisors. + * The managed instance capability * - * @member {string} [desiredState] Automatic tuning option desired state. - * Possible values include: 'Off', 'On', 'Default' - * @member {string} [actualState] Automatic tuning option actual state. - * Possible values include: 'Off', 'On' - * @member {number} [reasonCode] Reason code if desired and actual state are - * different. - * @member {string} [reasonDesc] Reason description if desired and actual state - * are different. Possible values include: 'Default', 'Disabled', - * 'AutoConfigured' + * @member {string} [name] The 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 AutomaticTuningServerOptions { - desiredState?: string; - readonly actualState?: string; - readonly reasonCode?: number; - readonly reasonDesc?: string; +export interface ManagedInstanceVersionCapability { + readonly name?: string; + readonly supportedEditions?: ManagedInstanceEditionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ServerAutomaticTuning class. + * Initializes a new instance of the LocationCapabilities class. * @constructor - * Server-level Automatic Tuning. + * The location 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 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 ServerAutomaticTuning extends ProxyResource { - desiredState?: string; - readonly actualState?: string; - options?: { [propertyName: string]: AutomaticTuningServerOptions }; +export interface LocationCapabilities { + readonly name?: string; + readonly supportedServerVersions?: ServerVersionCapability[]; + readonly supportedManagedInstanceVersions?: ManagedInstanceVersionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ServerDnsAlias class. + * Initializes a new instance of the Database class. * @constructor - * A server DNS alias. + * A database resource. + * + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [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. * - * @member {string} [azureDnsRecord] The fully qualified DNS record for alias + * 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 ServerDnsAlias extends ProxyResource { - readonly azureDnsRecord?: string; +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 ServerDnsAliasAcquisition class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * A server DNS alias acquisition request. + * A database resource. + * + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [createMode] Specifies the mode of database creation. * - * @member {string} [oldServerDnsAliasId] The id of the server alias that will - * be acquired to point to this server instead. + * 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. + * @member {object} [tags] Resource tags. */ -export interface ServerDnsAliasAcquisition { - oldServerDnsAliasId?: string; +export interface DatabaseUpdate { + sku?: Sku; + createMode?: string; + collation?: string; + maxSizeBytes?: number; + sampleName?: string; + elasticPoolId?: string; + sourceDatabaseId?: string; + readonly status?: string; + readonly databaseId?: string; + readonly creationDate?: Date; + readonly currentServiceObjectiveName?: string; + readonly requestedServiceObjectiveName?: string; + readonly defaultSecondaryLocation?: string; + readonly failoverGroupId?: string; + restorePointInTime?: Date; + sourceDatabaseDeletionDate?: Date; + recoveryServicesRecoveryPointId?: string; + longTermRetentionBackupResourceId?: string; + recoverableDatabaseId?: string; + restorableDroppedDatabaseId?: string; + catalogCollation?: string; + zoneRedundant?: boolean; + licenseType?: string; + readonly maxLogSizeBytes?: number; + readonly earliestRestoreDate?: Date; + readScale?: string; + readonly currentSku?: Sku; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the RestorePoint class. + * Initializes a new instance of the ResourceMoveDefinition class. * @constructor - * Database restore points. + * Contains the information necessary to perform a resource move (rename). * - * @member {string} [location] Resource location. - * @member {string} [restorePointType] The type of restore point. Possible - * values include: 'CONTINUOUS', 'DISCRETE' - * @member {date} [earliestRestoreDate] The earliest time to which this - * database can be restored - * @member {date} [restorePointCreationDate] The time the backup was taken - * @member {string} [restorePointLabel] The label of restore point for backup - * request by user + * @member {string} id The target ID for the resource */ -export interface RestorePoint extends ProxyResource { - readonly location?: string; - readonly restorePointType?: string; - readonly earliestRestoreDate?: Date; - readonly restorePointCreationDate?: Date; - readonly restorePointLabel?: string; +export interface ResourceMoveDefinition { + id: string; } /** * @class - * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. + * Initializes a new instance of the ElasticPoolPerDatabaseSettings class. * @constructor - * Contains the information necessary to perform a create database restore - * point operation. + * Per database settings of an elastic pool. * - * @member {string} restorePointLabel The restore point label to apply + * @member {number} [minCapacity] The minimum capacity all databases are + * guaranteed. + * @member {number} [maxCapacity] The maximum capacity any one database can + * consume. */ -export interface CreateDatabaseRestorePointDefinition { - restorePointLabel: string; +export interface ElasticPoolPerDatabaseSettings { + minCapacity?: number; + maxCapacity?: number; } /** * @class - * Initializes a new instance of the DatabaseOperation class. + * Initializes a new instance of the ElasticPool class. * @constructor - * A database operation. - * - * @member {string} [databaseName] The name of the database the operation is - * being performed on. - * @member {string} [operation] The name of operation. - * @member {string} [operationFriendlyName] The friendly name of operation. - * @member {number} [percentComplete] The percentage of the operation - * completed. - * @member {string} [serverName] The name of the server. - * @member {date} [startTime] The operation start time. - * @member {string} [state] The operation state. Possible values include: - * 'Pending', 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', - * 'Cancelled' - * @member {number} [errorCode] The operation error code. - * @member {string} [errorDescription] The operation error description. - * @member {number} [errorSeverity] The operation error severity. - * @member {boolean} [isUserError] Whether or not the error is a user error. - * @member {date} [estimatedCompletionTime] The estimated completion time of - * the operation. - * @member {string} [description] The operation description. - * @member {boolean} [isCancellable] Whether the operation can be cancelled. + * An elastic pool. + * + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of elastic pool. This is metadata used for the + * Azure portal experience. + * @member {string} [state] The state of the elastic pool. Possible values + * include: 'Creating', 'Ready', 'Disabled' + * @member {date} [creationDate] The creation date of the elastic pool (ISO8601 + * format). + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity all + * databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity any + * one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' */ -export interface DatabaseOperation extends ProxyResource { - readonly databaseName?: string; - readonly operation?: string; - readonly operationFriendlyName?: string; - readonly percentComplete?: number; - readonly serverName?: string; - readonly startTime?: Date; +export interface ElasticPool extends TrackedResource { + sku?: Sku; + readonly kind?: string; readonly state?: string; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; + readonly creationDate?: Date; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; } /** * @class - * Initializes a new instance of the ElasticPoolOperation class. + * Initializes a new instance of the ElasticPoolUpdate class. * @constructor - * A elastic pool operation. - * - * @member {string} [elasticPoolName] The name of the elastic pool the - * operation is being performed on. - * @member {string} [operation] The name of operation. - * @member {string} [operationFriendlyName] The friendly name of operation. - * @member {number} [percentComplete] The percentage of the operation - * completed. - * @member {string} [serverName] The name of the server. - * @member {date} [startTime] The operation start time. - * @member {string} [state] The operation state. - * @member {number} [errorCode] The operation error code. - * @member {string} [errorDescription] The operation error description. - * @member {number} [errorSeverity] The operation error severity. - * @member {boolean} [isUserError] Whether or not the error is a user error. - * @member {date} [estimatedCompletionTime] The estimated completion time of - * the operation. - * @member {string} [description] The operation description. - * @member {boolean} [isCancellable] Whether the operation can be cancelled. + * An elastic pool update. + * + * @member {object} [sku] + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {number} [maxSizeBytes] The storage limit for the database elastic + * pool in bytes. + * @member {object} [perDatabaseSettings] The per database settings for the + * elastic pool. + * @member {number} [perDatabaseSettings.minCapacity] The minimum capacity all + * databases are guaranteed. + * @member {number} [perDatabaseSettings.maxCapacity] The maximum capacity any + * one database can consume. + * @member {boolean} [zoneRedundant] Whether or not this elastic pool is zone + * redundant, which means the replicas of this elastic pool will be spread + * across multiple availability zones. + * @member {string} [licenseType] The license type to apply for this elastic + * pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {object} [tags] Resource tags. */ -export interface ElasticPoolOperation extends ProxyResource { - readonly elasticPoolName?: string; - readonly operation?: string; - readonly operationFriendlyName?: string; - readonly percentComplete?: number; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; - readonly estimatedCompletionTime?: Date; - readonly description?: string; - readonly isCancellable?: boolean; +export interface ElasticPoolUpdate { + sku?: Sku; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; + tags?: { [propertyName: string]: string }; } @@ -2688,72 +2888,76 @@ 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 MetricListResult class. + * Initializes a new instance of the FirewallRuleListResult class. * @constructor - * The response to a list database metrics request. + * Represents the response to a List Firewall Rules request. * */ -export interface MetricListResult extends Array { +export interface FirewallRuleListResult extends Array { } /** * @class - * Initializes a new instance of the MetricDefinitionListResult class. + * Initializes a new instance of the GeoBackupPolicyListResult class. * @constructor - * The response to a list database metric definitions request. + * The response to a list geo backup policies request. * */ -export interface MetricDefinitionListResult extends Array { +export interface GeoBackupPolicyListResult extends Array { } /** * @class - * Initializes a new instance of the DataMaskingRuleListResult class. + * Initializes a new instance of the MetricListResult class. * @constructor - * The response to a list data masking rules request. + * The response to a list database metrics request. * */ -export interface DataMaskingRuleListResult extends Array { +export interface MetricListResult extends Array { } /** * @class - * Initializes a new instance of the ElasticPoolListResult class. + * Initializes a new instance of the MetricDefinitionListResult class. * @constructor - * Represents the response to a list elastic pool request. + * The response to a list database metric definitions request. * */ -export interface ElasticPoolListResult extends Array { +export interface MetricDefinitionListResult extends Array { } /** * @class - * Initializes a new instance of the FirewallRuleListResult class. + * Initializes a new instance of the DatabaseListResult class. * @constructor - * Represents the response to a List Firewall Rules request. + * A list of databases. * + * @member {string} [nextLink] Link to retrieve next page of results. */ -export interface FirewallRuleListResult extends Array { +export interface DatabaseListResult extends Array { + readonly nextLink?: string; } /** * @class - * Initializes a new instance of the GeoBackupPolicyListResult class. + * Initializes a new instance of the ElasticPoolListResult class. * @constructor - * The response to a list geo backup policies request. + * The result of an elastic pool list request. * + * @member {string} [nextLink] Link to retrieve next page of results. */ -export interface GeoBackupPolicyListResult extends Array { +export interface ElasticPoolListResult extends Array { + readonly nextLink?: string; } /** diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 5948e14029..eb58f54c80 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -23,33 +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.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'); @@ -67,6 +46,14 @@ 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,16 +96,40 @@ exports.RestorePoint = require('./restorePoint'); exports.CreateDatabaseRestorePointDefinition = require('./createDatabaseRestorePointDefinition'); exports.DatabaseOperation = require('./databaseOperation'); exports.ElasticPoolOperation = require('./elasticPoolOperation'); +exports.MaxSizeCapability = require('./maxSizeCapability'); +exports.LogSizeCapability = require('./logSizeCapability'); +exports.MaxSizeRangeCapability = require('./maxSizeRangeCapability'); +exports.PerformanceLevelCapability = require('./performanceLevelCapability'); +exports.Sku = require('./sku'); +exports.LicenseTypeCapability = require('./licenseTypeCapability'); +exports.ServiceObjectiveCapability = require('./serviceObjectiveCapability'); +exports.EditionCapability = require('./editionCapability'); +exports.ElasticPoolPerDatabaseMinPerformanceLevelCapability = require('./elasticPoolPerDatabaseMinPerformanceLevelCapability'); +exports.ElasticPoolPerDatabaseMaxPerformanceLevelCapability = require('./elasticPoolPerDatabaseMaxPerformanceLevelCapability'); +exports.ElasticPoolPerformanceLevelCapability = require('./elasticPoolPerformanceLevelCapability'); +exports.ElasticPoolEditionCapability = require('./elasticPoolEditionCapability'); +exports.ServerVersionCapability = require('./serverVersionCapability'); +exports.ManagedInstanceVcoresCapability = require('./managedInstanceVcoresCapability'); +exports.ManagedInstanceFamilyCapability = require('./managedInstanceFamilyCapability'); +exports.ManagedInstanceEditionCapability = require('./managedInstanceEditionCapability'); +exports.ManagedInstanceVersionCapability = require('./managedInstanceVersionCapability'); +exports.LocationCapabilities = require('./locationCapabilities'); +exports.Database = require('./database'); +exports.DatabaseUpdate = require('./databaseUpdate'); +exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); +exports.ElasticPoolPerDatabaseSettings = require('./elasticPoolPerDatabaseSettings'); +exports.ElasticPool = require('./elasticPool'); +exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); exports.ServerListResult = require('./serverListResult'); -exports.DatabaseListResult = require('./databaseListResult'); -exports.MetricListResult = require('./metricListResult'); -exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); exports.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); -exports.ElasticPoolListResult = require('./elasticPoolListResult'); exports.FirewallRuleListResult = require('./firewallRuleListResult'); exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); +exports.MetricListResult = require('./metricListResult'); +exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); +exports.DatabaseListResult = require('./databaseListResult'); +exports.ElasticPoolListResult = require('./elasticPoolListResult'); exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ReplicationLinkListResult = require('./replicationLinkListResult'); diff --git a/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js b/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js new file mode 100644 index 0000000000..7149b0c6b8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/licenseTypeCapability.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The license type capability + * + */ +class LicenseTypeCapability { + /** + * Create a LicenseTypeCapability. + * @member {string} [name] License type identifier. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of LicenseTypeCapability + * + * @returns {object} metadata of LicenseTypeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'LicenseTypeCapability', + type: { + name: 'Composite', + className: 'LicenseTypeCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LicenseTypeCapability; diff --git a/lib/services/sqlManagement2/lib/models/locationCapabilities.js b/lib/services/sqlManagement2/lib/models/locationCapabilities.js index 4b7e537941..0f72b83c59 100644 --- a/lib/services/sqlManagement2/lib/models/locationCapabilities.js +++ b/lib/services/sqlManagement2/lib/models/locationCapabilities.js @@ -13,17 +13,21 @@ const models = require('./index'); /** - * The capabilities for a location. + * The location capability. * */ class LocationCapabilities { /** * Create a LocationCapabilities. * @member {string} [name] The location name. - * @member {string} [status] Azure SQL Database's status for the location. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedServerVersions] The list of supported server * versions. + * @member {array} [supportedManagedInstanceVersions] The list of supported + * managed instance versions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -50,30 +54,53 @@ class LocationCapabilities { name: 'String' } }, - status: { + supportedServerVersions: { required: false, readOnly: true, - serializedName: 'status', + serializedName: 'supportedServerVersions', type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'Sequence', + element: { + required: false, + serializedName: 'ServerVersionCapabilityElementType', + type: { + name: 'Composite', + className: 'ServerVersionCapability' + } + } } }, - supportedServerVersions: { + supportedManagedInstanceVersions: { required: false, readOnly: true, - serializedName: 'supportedServerVersions', + serializedName: 'supportedManagedInstanceVersions', type: { name: 'Sequence', element: { required: false, - serializedName: 'ServerVersionCapabilityElementType', + serializedName: 'ManagedInstanceVersionCapabilityElementType', type: { name: 'Composite', - className: 'ServerVersionCapability' + className: 'ManagedInstanceVersionCapability' } } } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/logSizeCapability.js b/lib/services/sqlManagement2/lib/models/logSizeCapability.js new file mode 100644 index 0000000000..939f3898f1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/logSizeCapability.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The log size capability. + * + */ +class LogSizeCapability { + /** + * Create a LogSizeCapability. + * @member {number} [limit] The log size limit (see 'unit' for the units). + * @member {string} [unit] The units that the limit is expressed in. Possible + * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', + * 'Percent' + */ + constructor() { + } + + /** + * Defines the metadata of LogSizeCapability + * + * @returns {object} metadata of LogSizeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'LogSizeCapability', + type: { + name: 'Composite', + className: 'LogSizeCapability', + modelProperties: { + limit: { + required: false, + readOnly: true, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogSizeCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js new file mode 100644 index 0000000000..c117ce2d74 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceEditionCapability.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed server capability + * + */ +class ManagedInstanceEditionCapability { + /** + * Create a ManagedInstanceEditionCapability. + * @member {string} [name] The managed server version name. + * @member {array} [supportedFamilies] The supported families. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceEditionCapability + * + * @returns {object} metadata of ManagedInstanceEditionCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceEditionCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceEditionCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + supportedFamilies: { + required: false, + readOnly: true, + serializedName: 'supportedFamilies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceFamilyCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceFamilyCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceEditionCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js new file mode 100644 index 0000000000..1ef2e7e779 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceFamilyCapability.js @@ -0,0 +1,151 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed server family capability. + * + */ +class ManagedInstanceFamilyCapability { + /** + * Create a ManagedInstanceFamilyCapability. + * @member {string} [name] Family name. + * @member {string} [sku] SKU name. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {array} [supportedVcoresValues] List of supported virtual cores + * values. + * @member {object} [includedMaxSize] Included size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see + * 'unit' for the units). + * @member {string} [includedMaxSize.unit] The units that the limit is + * expressed in. Possible values include: 'Megabytes', 'Gigabytes', + * 'Terabytes', 'Petabytes' + * @member {array} [supportedStorageSizes] Storage size ranges. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceFamilyCapability + * + * @returns {object} metadata of ManagedInstanceFamilyCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceFamilyCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceFamilyCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + sku: { + required: false, + readOnly: true, + serializedName: 'sku', + type: { + name: 'String' + } + }, + supportedLicenseTypes: { + required: false, + readOnly: true, + serializedName: 'supportedLicenseTypes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LicenseTypeCapabilityElementType', + type: { + name: 'Composite', + className: 'LicenseTypeCapability' + } + } + } + }, + supportedVcoresValues: { + required: false, + readOnly: true, + serializedName: 'supportedVcoresValues', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceVcoresCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceVcoresCapability' + } + } + } + }, + includedMaxSize: { + required: false, + readOnly: true, + serializedName: 'includedMaxSize', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + supportedStorageSizes: { + required: false, + readOnly: true, + serializedName: 'supportedStorageSizes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceFamilyCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js new file mode 100644 index 0000000000..2bed9e08d7 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceVcoresCapability.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The managed instance virtual cores capability. + * + */ +class ManagedInstanceVcoresCapability { + /** + * Create a ManagedInstanceVcoresCapability. + * @member {string} [name] The virtual cores identifier. + * @member {number} [value] The virtual cores value. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceVcoresCapability + * + * @returns {object} metadata of ManagedInstanceVcoresCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceVcoresCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceVcoresCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Number' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceVcoresCapability; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js b/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js new file mode 100644 index 0000000000..8cd7cdf2e5 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceVersionCapability.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The managed instance capability + * + */ +class ManagedInstanceVersionCapability { + /** + * Create a ManagedInstanceVersionCapability. + * @member {string} [name] The server version name. + * @member {array} [supportedEditions] The list of supported managed instance + * editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceVersionCapability + * + * @returns {object} metadata of ManagedInstanceVersionCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceVersionCapability', + type: { + name: 'Composite', + className: 'ManagedInstanceVersionCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + supportedEditions: { + required: false, + readOnly: true, + serializedName: 'supportedEditions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceEditionCapabilityElementType', + type: { + name: 'Composite', + className: 'ManagedInstanceEditionCapability' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceVersionCapability; diff --git a/lib/services/sqlManagement2/lib/models/maxSizeCapability.js b/lib/services/sqlManagement2/lib/models/maxSizeCapability.js index 04a717e819..14fe8dc472 100644 --- a/lib/services/sqlManagement2/lib/models/maxSizeCapability.js +++ b/lib/services/sqlManagement2/lib/models/maxSizeCapability.js @@ -11,18 +11,16 @@ 'use strict'; /** - * The maximum size limits for a database. + * The maximum size capability. * */ class MaxSizeCapability { /** * Create a MaxSizeCapability. - * @member {number} [limit] The maximum size of the database (see 'unit' for - * the units). + * @member {number} [limit] The maximum size limit (see 'unit' for the + * units). * @member {string} [unit] The units that the limit is expressed in. Possible * values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' - * @member {string} [status] The status of the maximum size capability. - * Possible values include: 'Visible', 'Available', 'Default', 'Disabled' */ constructor() { } @@ -54,17 +52,7 @@ class MaxSizeCapability { readOnly: true, serializedName: 'unit', type: { - name: 'Enum', - allowedValues: [ 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' ] - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'String' } } } diff --git a/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js b/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js new file mode 100644 index 0000000000..b5f5a10131 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/maxSizeRangeCapability.js @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The maximum size range capability. + * + */ +class MaxSizeRangeCapability { + /** + * Create a MaxSizeRangeCapability. + * @member {object} [minValue] Minimum value. + * @member {number} [minValue.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [minValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [maxValue] Maximum value. + * @member {number} [maxValue.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [maxValue.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [scaleSize] Scale/step size for discrete values between + * the minimum value and the maximum value. + * @member {number} [scaleSize.limit] The maximum size limit (see 'unit' for + * the units). + * @member {string} [scaleSize.unit] The units that the limit is expressed + * in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes' + * @member {object} [logSize] Size of transaction log. + * @member {number} [logSize.limit] The log size limit (see 'unit' for the + * units). + * @member {string} [logSize.unit] The units that the limit is expressed in. + * Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', + * 'Petabytes', 'Percent' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. + */ + constructor() { + } + + /** + * Defines the metadata of MaxSizeRangeCapability + * + * @returns {object} metadata of MaxSizeRangeCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'MaxSizeRangeCapability', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability', + modelProperties: { + minValue: { + required: false, + readOnly: true, + serializedName: 'minValue', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + maxValue: { + required: false, + readOnly: true, + serializedName: 'maxValue', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + scaleSize: { + required: false, + readOnly: true, + serializedName: 'scaleSize', + type: { + name: 'Composite', + className: 'MaxSizeCapability' + } + }, + logSize: { + required: false, + readOnly: true, + serializedName: 'logSize', + type: { + name: 'Composite', + className: 'LogSizeCapability' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MaxSizeRangeCapability; diff --git a/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js b/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js new file mode 100644 index 0000000000..236196e0d3 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/performanceLevelCapability.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The performance level capability. + * + */ +class PerformanceLevelCapability { + /** + * Create a PerformanceLevelCapability. + * @member {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' + */ + constructor() { + } + + /** + * Defines the metadata of PerformanceLevelCapability + * + * @returns {object} metadata of PerformanceLevelCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'PerformanceLevelCapability', + type: { + name: 'Composite', + className: 'PerformanceLevelCapability', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PerformanceLevelCapability; diff --git a/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js b/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js index 1a55e0d85e..dd8c75d9c7 100644 --- a/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js +++ b/lib/services/sqlManagement2/lib/models/recommendedElasticPool.js @@ -157,10 +157,10 @@ class RecommendedElasticPool extends models['ProxyResource'] { name: 'Sequence', element: { required: false, - serializedName: 'DatabaseElementType', + serializedName: 'TrackedResourceElementType', type: { name: 'Composite', - className: 'Database' + className: 'TrackedResource' } } } diff --git a/lib/services/sqlManagement2/lib/models/serverVersionCapability.js b/lib/services/sqlManagement2/lib/models/serverVersionCapability.js index add9a6e39a..aa369f80bb 100644 --- a/lib/services/sqlManagement2/lib/models/serverVersionCapability.js +++ b/lib/services/sqlManagement2/lib/models/serverVersionCapability.js @@ -13,19 +13,21 @@ const models = require('./index'); /** - * The server capabilities. + * The server capability * */ class ServerVersionCapability { /** * Create a ServerVersionCapability. * @member {string} [name] The server version name. - * @member {string} [status] The status of the server version. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' * @member {array} [supportedEditions] The list of supported database * editions. * @member {array} [supportedElasticPoolEditions] The list of supported * elastic pool editions. + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -52,15 +54,6 @@ class ServerVersionCapability { name: 'String' } }, - status: { - required: false, - readOnly: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] - } - }, supportedEditions: { required: false, readOnly: true, @@ -92,6 +85,22 @@ class ServerVersionCapability { } } } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js b/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js index f700e2a0ab..0b9970c1e5 100644 --- a/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js +++ b/lib/services/sqlManagement2/lib/models/serviceObjectiveCapability.js @@ -19,25 +19,34 @@ const models = require('./index'); class ServiceObjectiveCapability { /** * Create a ServiceObjectiveCapability. - * @member {string} [name] The service objective name. - * @member {string} [status] The status of the service objective. Possible - * values include: 'Visible', 'Available', 'Default', 'Disabled' - * @member {string} [unit] Unit type used to measure service objective - * performance level. Possible values include: 'DTU' - * @member {number} [value] Performance level value. * @member {uuid} [id] The unique ID of the service objective. + * @member {string} [name] The service objective name. * @member {array} [supportedMaxSizes] The list of supported maximum database - * sizes for this service objective. - * @member {object} [includedMaxSize] The included (free) max size for this - * service level objective. - * @member {number} [includedMaxSize.limit] The maximum size of the database - * (see 'unit' for the units). + * sizes. + * @member {object} [performanceLevel] The performance level. + * @member {number} [performanceLevel.value] Performance level value. + * @member {string} [performanceLevel.unit] Unit type used to measure + * performance level. Possible values include: 'DTU', 'VCores' + * @member {object} [sku] The sku. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {array} [supportedLicenseTypes] List of supported license types. + * @member {object} [includedMaxSize] The included (free) max size. + * @member {number} [includedMaxSize.limit] The maximum size limit (see + * 'unit' for the units). * @member {string} [includedMaxSize.unit] The units that the limit is * expressed in. Possible values include: 'Megabytes', 'Gigabytes', * 'Terabytes', 'Petabytes' - * @member {string} [includedMaxSize.status] The status of the maximum size - * capability. Possible values include: 'Visible', 'Available', 'Default', - * 'Disabled' + * @member {string} [status] The status of the capability. Possible values + * include: 'Visible', 'Available', 'Default', 'Disabled' + * @member {string} [reason] The reason for the capability not being + * available. */ constructor() { } @@ -56,60 +65,68 @@ class ServiceObjectiveCapability { name: 'Composite', className: 'ServiceObjectiveCapability', modelProperties: { - name: { + id: { required: false, readOnly: true, - serializedName: 'name', + serializedName: 'id', type: { name: 'String' } }, - status: { + name: { required: false, readOnly: true, - serializedName: 'status', + serializedName: 'name', type: { - name: 'Enum', - allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + name: 'String' } }, - unit: { + supportedMaxSizes: { required: false, readOnly: true, - serializedName: 'performanceLevel.unit', + serializedName: 'supportedMaxSizes', type: { - name: 'Enum', - allowedValues: [ 'DTU' ] + name: 'Sequence', + element: { + required: false, + serializedName: 'MaxSizeRangeCapabilityElementType', + type: { + name: 'Composite', + className: 'MaxSizeRangeCapability' + } + } } }, - value: { + performanceLevel: { required: false, readOnly: true, - serializedName: 'performanceLevel.value', + serializedName: 'performanceLevel', type: { - name: 'Number' + name: 'Composite', + className: 'PerformanceLevelCapability' } }, - id: { + sku: { required: false, readOnly: true, - serializedName: 'id', + serializedName: 'sku', type: { - name: 'String' + name: 'Composite', + className: 'Sku' } }, - supportedMaxSizes: { + supportedLicenseTypes: { required: false, readOnly: true, - serializedName: 'supportedMaxSizes', + serializedName: 'supportedLicenseTypes', type: { name: 'Sequence', element: { required: false, - serializedName: 'MaxSizeCapabilityElementType', + serializedName: 'LicenseTypeCapabilityElementType', type: { name: 'Composite', - className: 'MaxSizeCapability' + className: 'LicenseTypeCapability' } } } @@ -122,6 +139,22 @@ class ServiceObjectiveCapability { name: 'Composite', className: 'MaxSizeCapability' } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/sku.js b/lib/services/sqlManagement2/lib/models/sku.js new file mode 100644 index 0000000000..698c630dff --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/sku.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An ARM Resource SKU. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} name The name of the SKU, typically, a letter + Number + * code, e.g. P3. + * @member {string} [tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [size] Size of the particular SKU + * @member {string} [family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [capacity] Capacity of the particular SKU. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/sqlManagement2/lib/operations/capabilities.js b/lib/services/sqlManagement2/lib/operations/capabilities.js index cd8f64438f..86da4bf0e9 100644 --- a/lib/services/sqlManagement2/lib/operations/capabilities.js +++ b/lib/services/sqlManagement2/lib/operations/capabilities.js @@ -15,12 +15,18 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -37,7 +43,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByLocation(locationId, options, callback) { +function _listByLocation(locationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47,15 +53,19 @@ function _listByLocation(locationId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let include = (options && options.include !== undefined) ? options.include : undefined; + let apiVersion = '2017-10-01-preview'; // Validate try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (include !== null && include !== undefined && typeof include.valueOf() !== 'string') { + throw new Error('include must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (locationId === null || locationId === undefined || typeof locationId.valueOf() !== 'string') { - throw new Error('locationId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,10 +75,13 @@ function _listByLocation(locationId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{locationId}', encodeURIComponent(locationId)); let queryParameters = []; + if (include !== null && include !== undefined) { + queryParameters.push('include=' + encodeURIComponent(include)); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -163,12 +176,18 @@ class Capabilities { } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -178,11 +197,11 @@ class Capabilities { * * @reject {Error} - The error object. */ - listByLocationWithHttpOperationResponse(locationId, options) { + listByLocationWithHttpOperationResponse(locationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByLocation(locationId, options, (err, result, request, response) => { + self._listByLocation(locationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -193,12 +212,18 @@ class Capabilities { } /** - * Gets the capabilities available for the specified location. + * Gets the subscription capabilities available for the specified location. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -224,7 +249,7 @@ class Capabilities { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByLocation(locationId, options, optionalCallback) { + listByLocation(locationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -233,14 +258,14 @@ class Capabilities { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByLocation(locationId, options, (err, result, request, response) => { + self._listByLocation(locationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByLocation(locationId, options, optionalCallback); + return self._listByLocation(locationName, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index 7e2d2ea7df..7febf21ad9 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -16,7 +16,7 @@ const WebResource = msRest.WebResource; /** - * Pauses a data warehouse. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -24,74 +24,47 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. - * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.databaseName The name of the database to import. * - * @param {function} callback - The callback. + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * - * @returns {function} callback(err, result, request, response) + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _pause(resourceGroupName, serverName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Resumes a data warehouse. + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} serverName The name of the server. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -104,13 +77,14 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resume(resourceGroupName, serverName, databaseName, options, callback) { +function _importMethod(resourceGroupName, serverName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -123,7 +97,7 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) } // Send request - this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -142,6 +116,20 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) if (responseBody === '') responseBody = null; // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } return callback(null, result, httpRequest, response); }); @@ -150,7 +138,8 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) /** - * Creates a new database or updates an existing database. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -158,146 +147,31 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} databaseName The name of the database to import into * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} [parameters.name] The name of the extension. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} [parameters.type] The type of the extension. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -311,13 +185,13 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -330,7 +204,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -354,7 +228,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -371,7 +245,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters /** - * Updates an existing database. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -379,142 +253,26 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {string} databaseName The name of the database to be exported. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} parameters The required parameters for exporting a database. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageUri The storage uri to use. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -528,13 +286,13 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -547,7 +305,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option } // Send request - this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -571,7 +329,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -587,7 +345,7 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option } /** - * Deletes a database. + * Returns database metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -595,7 +353,10 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -608,13 +369,14 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { +function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -639,6 +401,9 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -648,20 +413,21 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -686,7 +452,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -714,13 +480,30 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MetricListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets a database. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -728,14 +511,10 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -746,13 +525,14 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -762,7 +542,6 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; let apiVersion = '2014-04-01'; // Validate try { @@ -778,9 +557,6 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -790,16 +566,13 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -866,7 +639,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -881,8 +654,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { }); } + /** - * Returns a list of databases in a server. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -890,14 +664,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} databaseName The name of the database to be upgraded. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -908,147 +677,52 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByServer(resourceGroupName, serverName, options, callback) { +function _upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand must be of type string.'); - } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1056,11 +730,6 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1073,13 +742,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1089,23 +758,17 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1116,12 +779,10 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1190,7 +851,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['DatabaseListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1206,7 +867,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab } /** - * Returns a list of databases in an elastic pool. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1214,8 +875,7 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1229,13 +889,13 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _get(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1245,20 +905,20 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1269,11 +929,11 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1342,7 +1002,7 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1357,8 +1017,9 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti }); } + /** - * Gets a database inside of a recommented elastic pool. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1366,135 +1027,170 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @param {string} databaseName The name of the database. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {object} parameters The requested database resource state. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {function} callback - The callback. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @returns {function} callback(err, result, request, response) + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); + if (!callback) { + throw new Error('callback cannot be null.'); } - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1509,14 +1205,15 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Returns a list of databases inside a recommented elastic pool. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1524,8 +1221,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1538,138 +1234,53 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, callback) { +function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (recommendedElasticPoolName === null || recommendedElasticPoolName === undefined || typeof recommendedElasticPoolName.valueOf() !== 'string') { - throw new Error('recommendedElasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DatabaseListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); } /** - * Imports a bacpac into a new database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1677,154 +1288,117 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.databaseName The name of the database to import. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Default: regular database creation. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {object} [options] Optional Parameters. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {function} callback - The callback. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @returns {function} callback(err, result, request, response) + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * {Error} err - The Error object if an error occurred, null otherwise. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.collation] The collation of the database. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _importMethod(resourceGroupName, serverName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginImportMethod(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @param {string} serverName The name of the server. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} databaseName The name of the database to import into + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.name] The name of the extension. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.type] The type of the extension. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1838,13 +1412,13 @@ function _importMethod(resourceGroupName, serverName, parameters, options, callb * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1857,7 +1431,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par } // Send request - this.beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -1881,7 +1455,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1896,9 +1470,8 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par }); } - /** - * Exports a database to a bacpac. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1906,26 +1479,7 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1939,141 +1493,53 @@ function _createImportOperation(resourceGroupName, serverName, databaseName, par * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _exportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } - - // Send request - this.beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Returns database metrics. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listMetrics(resourceGroupName, serverName, databaseName, filter, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2140,7 +1606,7 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); + let resultMapper = new client.models['DatabaseListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2155,8 +1621,9 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio }); } + /** - * Returns database metric definitions. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2164,7 +1631,7 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -2178,121 +1645,50 @@ function _listMetrics(resourceGroupName, serverName, databaseName, filter, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, databaseName, options, callback) { +function _pause(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2301,14 +1697,15 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Renames a database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2316,12 +1713,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to rename. - * - * @param {object} parameters The resource move definition for renaming this - * database. - * - * @param {string} parameters.id The target ID for the resource + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -2334,37 +1726,123 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _resume(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } + + // Send request + this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Renames a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -2463,7 +1941,7 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option } /** - * Pauses a data warehouse. + * Imports a bacpac into a new database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2471,7 +1949,47 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2484,13 +2002,14 @@ function _rename(resourceGroupName, serverName, databaseName, parameters, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { +function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2512,8 +2031,8 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -2524,11 +2043,10 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2555,7 +2073,21 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImportRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -2590,13 +2122,31 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Resumes a data warehouse. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2604,7 +2154,31 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2617,13 +2191,14 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { +function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2634,6 +2209,11 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call throw new Error('callback cannot be null.'); } let apiVersion = '2014-04-01'; + let extensionName = 'import'; + if (parameters === null || parameters === undefined) + { + parameters = {}; + } // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2648,6 +2228,9 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2657,11 +2240,12 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -2670,7 +2254,7 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2688,14 +2272,28 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2723,160 +2321,57 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates a new database or updates an existing database. - * + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ImportExportResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Exports a database to a bacpac. + * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} databaseName The name of the database to be exported. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} parameters.storageUri The storage uri to use. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -2890,13 +2385,13 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2933,7 +2428,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -2946,7 +2441,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2969,7 +2464,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['Database']().mapper(); + let requestModelMapper = new client.models['ExportRequest']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -2985,7 +2480,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3020,7 +2515,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); + let resultMapper = new client.models['ImportExportResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3030,30 +2525,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); } /** - * Updates an existing database. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3061,142 +2539,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3209,14 +2552,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3226,12 +2568,9 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3241,8 +2580,8 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3253,11 +2592,11 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3266,7 +2605,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3284,21 +2623,7 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -3333,30 +2658,13 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Imports a bacpac into a new database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3364,52 +2672,124 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.databaseName The name of the database to import. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Default: regular database creation. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {object} [options] Optional Parameters. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * * @param {function} callback - The callback. * @@ -3418,13 +2798,13 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginImportMethod(resourceGroupName, serverName, parameters, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3434,21 +2814,24 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3458,10 +2841,11 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3470,7 +2854,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3493,7 +2877,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportRequest']().mapper(); + let requestModelMapper = new client.models['Database']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3509,7 +2893,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3544,7 +2928,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3554,14 +2938,30 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3569,31 +2969,7 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3606,14 +2982,13 @@ function _beginImportMethod(resourceGroupName, serverName, parameters, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3623,17 +2998,9 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let extensionName = 'import'; - if (parameters === null || parameters === undefined) - { - parameters = {}; - } + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3643,8 +3010,8 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3655,12 +3022,11 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{extensionName}', encodeURIComponent(extensionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3669,7 +3035,7 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3687,28 +3053,14 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ImportExtensionRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3736,30 +3088,13 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Exports a database to a bacpac. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3767,26 +3102,117 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for exporting a database. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -3800,13 +3226,13 @@ function _beginCreateImportOperation(resourceGroupName, serverName, databaseName * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3816,12 +3242,9 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -3834,6 +3257,9 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3843,11 +3269,11 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3856,7 +3282,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3879,7 +3305,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExportRequest']().mapper(); + let requestModelMapper = new client.models['DatabaseUpdate']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -3930,7 +3356,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ImportExportResponse']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3945,42 +3371,1150 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet }); } -/** Class representing a Databases. */ -class Databases { - /** - * Create a Databases. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._pause = _pause; - this._resume = _resume; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; - this._getByElasticPool = _getByElasticPool; - this._listByElasticPool = _listByElasticPool; - this._getByRecommendedElasticPool = _getByRecommendedElasticPool; - this._listByRecommendedElasticPool = _listByRecommendedElasticPool; - this._importMethod = _importMethod; - this._createImportOperation = _createImportOperation; - this._exportMethod = _exportMethod; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; - this._rename = _rename; - this._beginPause = _beginPause; - this._beginResume = _beginResume; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._beginImportMethod = _beginImportMethod; - this._beginCreateImportOperation = _beginCreateImportOperation; - this._beginExportMethod = _beginExportMethod; +/** + * Pauses a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be paused. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Resumes a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be resumed. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of databases in an elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPoolNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Databases. */ +class Databases { + /** + * Create a Databases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._importMethod = _importMethod; + this._createImportOperation = _createImportOperation; + this._exportMethod = _exportMethod; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._upgradeDataWarehouse = _upgradeDataWarehouse; + this._listByServer = _listByServer; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listByElasticPool = _listByElasticPool; + this._pause = _pause; + this._resume = _resume; + this._rename = _rename; + this._beginImportMethod = _beginImportMethod; + this._beginCreateImportOperation = _beginCreateImportOperation; + this._beginExportMethod = _beginExportMethod; + this._beginUpgradeDataWarehouse = _beginUpgradeDataWarehouse; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._beginPause = _beginPause; + this._beginResume = _beginResume; + this._listByServerNext = _listByServerNext; + this._listByElasticPoolNext = _listByElasticPoolNext; + } + + /** + * Imports a bacpac into a new database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Imports a bacpac into a new database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Exports a database to a bacpac. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Exports a database to a bacpac. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Returns database metrics. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns database metrics. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); + } } /** - * Pauses a data warehouse. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -3988,7 +4522,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3997,15 +4531,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4016,7 +4550,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Returns database metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4024,7 +4558,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4038,7 +4572,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4046,13 +4580,15 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4061,19 +4597,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Resumes a data warehouse. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4081,7 +4617,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -4094,11 +4630,11 @@ class Databases { * * @reject {Error} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4109,7 +4645,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4117,7 +4653,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -4145,7 +4681,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { + upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4154,19 +4690,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates a new database or updates an existing database. + * Gets a list of databases. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4174,146 +4710,97 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * Default: regular database creation. + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of databases. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {object} [options] Optional Parameters. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {function} [optionalCallback] - The optional callback. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * {Promise} A promise is returned * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * @resolve {DatabaseListResult} - The deserialized result object. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @reject {Error} - The error object. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * {function} optionalCallback(err, result, request, response) * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. * - * @param {object} [parameters.tags] Resource tags. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} parameters.location Resource location. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Gets a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4326,11 +4813,11 @@ class Databases { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4341,7 +4828,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Gets a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4349,146 +4836,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4517,7 +4865,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4526,19 +4874,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Updates an existing database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4546,14 +4894,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The requested database resource state. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -4563,9 +4921,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -4586,103 +4944,70 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4694,11 +5019,11 @@ class Databases { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4709,7 +5034,7 @@ class Databases { } /** - * Updates an existing database. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4717,14 +5042,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -4734,9 +5069,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -4757,103 +5092,70 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4881,7 +5183,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4890,19 +5192,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Deletes a database. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4910,7 +5212,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4938,7 +5240,7 @@ class Databases { } /** - * Deletes a database. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4946,7 +5248,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -4995,7 +5297,7 @@ class Databases { } /** - * Gets a database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5003,13 +5305,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5020,11 +5428,11 @@ class Databases { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5035,7 +5443,7 @@ class Databases { } /** - * Gets a database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5043,117 +5451,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {Promise} A promise is returned + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @resolve {Database} - The deserialized result object. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @reject {Error} - The error object. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * {function} optionalCallback(err, result, request, response) + * Default: regular database creation. * - * {Error} err - The Error object if an error occurred, null otherwise. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * {object} [request] - The HTTP Request object if an error did not occur. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Returns a list of databases in a server. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} serverName The name of the server. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {object} [options] Optional Parameters. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @returns {Promise} A promise is returned + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @reject {Error} - The error object. - */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns a list of databases in a server. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5165,7 +5575,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5174,13 +5584,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5189,19 +5599,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5209,10 +5619,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5221,15 +5628,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, databaseName, options) { + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5240,7 +5647,7 @@ class Databases { } /** - * Gets a database inside of an elastic pool. + * Gets a list of databases in an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5248,10 +5655,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5265,7 +5669,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5274,13 +5678,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback) { + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5289,19 +5693,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback); + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Returns a list of databases in an elastic pool. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5309,8 +5713,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5319,15 +5722,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5338,7 +5741,7 @@ class Databases { } /** - * Returns a list of databases in an elastic pool. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5346,8 +5749,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5361,7 +5763,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5370,13 +5772,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5385,19 +5787,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Gets a database inside of a recommented elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5405,10 +5807,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5421,11 +5820,11 @@ class Databases { * * @reject {Error} - The error object. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options) { + resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5436,7 +5835,7 @@ class Databases { } /** - * Gets a database inside of a recommented elastic pool. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5444,10 +5843,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5476,7 +5872,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback) { + resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5485,19 +5881,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, (err, result, request, response) => { + self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback); + return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5505,8 +5901,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5515,15 +5915,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, options) { + renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5534,7 +5934,7 @@ class Databases { } /** - * Returns a list of databases inside a recommented elastic pool. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5542,8 +5942,12 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} databaseName The name of the database to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -5557,7 +5961,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5565,14 +5969,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback) { + rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5581,14 +5984,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, (err, result, request, response) => { + self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback); + return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } @@ -5654,11 +6057,11 @@ class Databases { * * @reject {Error} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5746,7 +6149,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5755,14 +6158,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); } } @@ -5813,11 +6216,11 @@ class Databases { * * @reject {Error} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5890,7 +6293,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5899,14 +6302,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } @@ -5951,11 +6354,11 @@ class Databases { * * @reject {Error} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6022,7 +6425,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6031,19 +6434,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns database metrics. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6051,10 +6454,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -6063,15 +6463,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, filter, options) { + beginUpgradeDataWarehouseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6082,7 +6482,7 @@ class Databases { } /** - * Returns database metrics. + * Upgrades a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6090,10 +6490,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -6107,7 +6504,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6115,14 +6512,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { + beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6131,19 +6527,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, (err, result, request, response) => { + self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); + return self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns database metric definitions. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6153,203 +6549,117 @@ class Databases { * * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested database resource state. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @returns {Promise} A promise is returned + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @reject {Error} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns database metric definitions. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} serverName The name of the server. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} databaseName The name of the database. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {object} [options] Optional Parameters. + * Default: regular database creation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @param {function} [optionalCallback] - The optional callback. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * {Promise} A promise is returned + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @reject {Error} - The error object. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * {function} optionalCallback(err, result, request, response) + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.collation] The collation of the database. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Renames a database. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} serverName The name of the server. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} databaseName The name of the database to rename. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {object} parameters The resource move definition for renaming this + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this * database. * - * @param {string} parameters.id The target ID for the resource - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Renames a database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to rename. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} parameters The resource move definition for renaming this + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this * database. * - * @param {string} parameters.id The target ID for the resource - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); - } - } - - /** - * Pauses a data warehouse. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' * - * @param {string} serverName The name of the server. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6358,15 +6668,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6377,7 +6687,7 @@ class Databases { } /** - * Pauses a data warehouse. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6385,7 +6695,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this database is + * zone redundant, which means the replicas of this database will be spread + * across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -6399,7 +6821,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6407,13 +6829,14 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6422,19 +6845,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6442,7 +6865,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6455,11 +6878,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6470,7 +6893,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Deletes the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6478,7 +6901,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6506,7 +6929,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6515,19 +6938,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6535,14 +6958,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -6552,9 +6985,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -6575,106 +7008,67 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6687,11 +7081,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6702,7 +7096,7 @@ class Databases { } /** - * Creates a new database or updates an existing database. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6710,14 +7104,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * * @param {string} [parameters.createMode] Specifies the mode of database * creation. @@ -6727,9 +7131,9 @@ class Databases { * Copy: creates a database as a copy of an existing database. sourceDatabaseId * must be specified as the resource ID of the source database. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. * * PointInTimeRestore: Creates a database by restoring a point in time backup * of an existing database. sourceDatabaseId must be specified as the resource @@ -6750,106 +7154,67 @@ class Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. + * + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. + * + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. + * + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * * @param {boolean} [parameters.zoneRedundant] Whether or not this database is * zone redundant, which means the replicas of this database will be spread * across multiple availability zones. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6878,7 +7243,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6887,19 +7252,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Updates an existing database. + * Pauses a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6907,142 +7272,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -7055,11 +7285,11 @@ class Databases { * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + beginPauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7069,151 +7299,16 @@ class Databases { }); } - /** - * Updates an existing database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + /** + * Pauses a database. * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database is - * zone redundant, which means the replicas of this database will be spread - * across multiple availability zones. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -7242,7 +7337,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7251,19 +7346,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._beginPause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginPause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Imports a bacpac into a new database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7271,47 +7366,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -7320,15 +7375,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + beginResumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7339,7 +7394,7 @@ class Databases { } /** - * Imports a bacpac into a new database. + * Resumes a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -7347,47 +7402,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - * 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'System', - * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -7401,7 +7416,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7410,13 +7425,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7425,52 +7440,22 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._beginResume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginResume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * Gets a list of databases. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7479,15 +7464,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByServerNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7498,40 +7483,10 @@ class Databases { } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. + * Gets a list of databases. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7545,7 +7500,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7554,13 +7509,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByServerNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7569,46 +7524,22 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByServerNext(nextPageLink, options, optionalCallback); } } /** - * Exports a database to a bacpac. + * Gets a list of databases in an elastic pool. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7617,15 +7548,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByElasticPoolNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7636,34 +7567,10 @@ class Databases { } /** - * Exports a database to a bacpac. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * Gets a list of databases in an elastic pool. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7677,7 +7584,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7686,13 +7593,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * See {@link DatabaseListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByElasticPoolNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7701,14 +7608,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByElasticPoolNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/elasticPools.js b/lib/services/sqlManagement2/lib/operations/elasticPools.js index b0c55afc5e..00900cb8d8 100644 --- a/lib/services/sqlManagement2/lib/operations/elasticPools.js +++ b/lib/services/sqlManagement2/lib/operations/elasticPools.js @@ -14,118 +14,8 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; - -/** - * Creates a new elastic pool or updates an existing elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - - /** - * Updates an existing elastic pool. + * Returns elastic pool metrics. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -133,31 +23,10 @@ function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, paramet * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -171,93 +40,13 @@ function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, paramet * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Deletes the elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -282,6 +71,9 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } + if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { + throw new Error('filter cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -291,20 +83,21 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -329,7 +122,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -357,13 +150,30 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MetricListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets an elastic pool. + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -371,8 +181,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -386,13 +195,14 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * See {@link MetricDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -426,7 +236,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); @@ -499,7 +309,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); + let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -515,7 +325,7 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) } /** - * Returns a list of elastic pools in a server. + * Gets all elastic pools in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -525,6 +335,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * * @param {object} [options] Optional Parameters. * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -551,18 +364,22 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { throw new Error('serverName cannot be null or undefined and it must be of type string.'); } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -573,10 +390,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -660,7 +480,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { } /** - * Returns elastic pool metrics. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -670,9 +490,6 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -685,13 +502,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, callback) { +function _get(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -701,12 +518,9 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -716,8 +530,8 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } - if (filter === null || filter === undefined || typeof filter.valueOf() !== 'string') { - throw new Error('filter cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -728,14 +542,13 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - queryParameters.push('$filter=' + encodeURIComponent(filter)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -802,7 +615,7 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -817,8 +630,9 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op }); } + /** - * Returns elastic pool metric definitions. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -828,6 +642,46 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * * @param {string} elasticPoolName The name of the elastic pool. * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -840,121 +694,50 @@ function _listMetrics(resourceGroupName, serverName, elasticPoolName, filter, op * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MetricDefinitionListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -963,14 +746,15 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Creates a new elastic pool or updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -978,34 +762,112 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {function} callback - The callback. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @returns {function} callback(err, result, request, response) * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.tags] Resource tags. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an elastic pool. * - * @param {string} parameters.location Resource location. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1025,53 +887,174 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _update(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1182,7 +1165,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa } /** - * Updates an existing elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1190,31 +1173,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1227,14 +1186,13 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1244,12 +1202,9 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-10-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -1259,8 +1214,8 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1272,10 +1227,10 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1284,7 +1239,7 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1302,28 +1257,14 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ElasticPoolUpdate']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1351,112 +1292,503 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPool']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } -/** Class representing a ElasticPools. */ -class ElasticPools { - /** - * Create a ElasticPools. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; - this._listMetrics = _listMetrics; - this._listMetricDefinitions = _listMetricDefinitions; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - } - - /** - * Creates a new elastic pool or updates an existing elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a new elastic pool or updates an existing elastic pool. +/** + * Updates an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ElasticPoolUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPool']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all elastic pools in a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ElasticPools. */ +class ElasticPools { + /** + * Create a ElasticPools. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listMetrics = _listMetrics; + this._listMetricDefinitions = _listMetricDefinitions; + this._listByServer = _listByServer; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listByServerNext = _listByServerNext; + } + + /** + * Returns elastic pool metrics. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metrics. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + } + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metric definitions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1464,34 +1796,198 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {function} [optionalCallback] - The optional callback. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * {Promise} A promise is returned * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @reject {Error} - The error object. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * {function} optionalCallback(err, result, request, response) * - * @param {object} [parameters.tags] Resource tags. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} parameters.location Resource location. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * Gets all elastic pools in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all elastic pools in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Gets an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1520,7 +2016,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1529,19 +2025,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1549,31 +2045,47 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {object} parameters The elastic pool parameters. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1586,11 +2098,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1601,39 +2113,55 @@ class ElasticPools { } /** - * Updates an existing elastic pool. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} parameters The required parameters for updating an elastic - * pool. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {object} [parameters.tags] Resource tags. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1662,7 +2190,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1671,19 +2199,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1691,7 +2219,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1719,7 +2247,7 @@ class ElasticPools { } /** - * Deletes the elastic pool. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1727,7 +2255,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1776,7 +2304,7 @@ class ElasticPools { } /** - * Gets an elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1784,8 +2312,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1798,11 +2363,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1813,7 +2378,7 @@ class ElasticPools { } /** - * Gets an elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1821,8 +2386,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1851,7 +2453,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1860,53 +2462,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Returns a list of elastic pools in a server. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns a list of elastic pools in a server. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1914,66 +2482,47 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters The elastic pool parameters. * - * @param {function} [optionalCallback] - The optional callback. + * @param {object} [parameters.sku] * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * {Promise} A promise is returned + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @reject {Error} - The error object. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {function} optionalCallback(err, result, request, response) + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolListResult} for more information. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByServer(resourceGroupName, serverName, options, optionalCallback); - } - } - - /** - * Returns elastic pool metrics. + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -1982,15 +2531,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, filter, options) { + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2001,7 +2550,7 @@ class ElasticPools { } /** - * Returns elastic pool metrics. + * Creates or updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2011,8 +2560,45 @@ class ElasticPools { * * @param {string} elasticPoolName The name of the elastic pool. * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. + * @param {object} parameters The elastic pool parameters. + * + * @param {object} [parameters.sku] + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. + * + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -2026,7 +2612,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2035,13 +2621,13 @@ class ElasticPools { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * See {@link ElasticPool} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2050,19 +2636,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, (err, result, request, response) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Returns elastic pool metric definitions. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2079,15 +2665,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2098,7 +2684,7 @@ class ElasticPools { } /** - * Returns elastic pool metric definitions. + * Deletes an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2120,7 +2706,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2128,15 +2714,13 @@ class ElasticPools { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2145,19 +2729,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2165,34 +2749,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} parameters The elastic pool update parameters. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} [parameters.sku] * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {string} parameters.location Resource location. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2205,11 +2800,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2220,7 +2815,7 @@ class ElasticPools { } /** - * Creates a new elastic pool or updates an existing elastic pool. + * Updates an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2228,34 +2823,45 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). + * @param {string} elasticPoolName The name of the elastic pool. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} parameters The elastic pool update parameters. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.sku] * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} [parameters.tags] Resource tags. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {string} parameters.location Resource location. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. + * + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {number} [parameters.perDatabaseSettings.maxCapacity] The maximum + * capacity any one database can consume. + * + * @param {boolean} [parameters.zoneRedundant] Whether or not this elastic pool + * is zone redundant, which means the replicas of this elastic pool will be + * spread across multiple availability zones. + * + * @param {string} [parameters.licenseType] The license type to apply for this + * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice' + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2284,7 +2890,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2293,51 +2899,22 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Updates an existing elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * Gets all elastic pools in a server. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2346,15 +2923,15 @@ class ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + listByServerNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2365,39 +2942,10 @@ class ElasticPools { } /** - * Updates an existing elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets all elastic pools in a server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {boolean} [parameters.zoneRedundant] Whether or not this database - * elastic pool is zone redundant, which means the replicas of this database - * will be spread across multiple availability zones. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2411,7 +2959,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2420,13 +2968,13 @@ class ElasticPools { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * See {@link ElasticPoolListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + listByServerNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2435,14 +2983,14 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); + return self._listByServerNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index 3af2447f44..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,55 @@ 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} databaseName The name of the database. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} dataMaskingRuleName The name of the data masking rule. * - * Default: regular database creation. + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. * - * 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.aliasName] The alias name. This is a legacy + * parameter and is no longer used. * - * 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.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' * - * 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.schemaName The schema name on which the data + * masking rule is applied. * - * 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.tableName The table name on which the data + * masking rule is applied. * - * 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.columnName The column name on which the data + * masking rule is applied. * - * 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.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' * - * 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.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * @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.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.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.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.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.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 {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.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. * @@ -2019,14 +1777,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 @@ -2034,142 +1792,55 @@ 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} databaseName The name of the database. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {string} dataMaskingRuleName The name of the data masking rule. * - * Default: regular database creation. + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. * - * 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.aliasName] The alias name. This is a legacy + * parameter and is no longer used. * - * 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.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' * - * 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.schemaName The schema name on which the data + * masking rule is applied. * - * 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.tableName The table name on which the data + * masking rule is applied. * - * 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.columnName The column name on which the data + * masking rule is applied. * - * 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.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' * - * 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.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. * - * @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.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.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.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.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.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 {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.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. * @@ -2183,7 +1854,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {DataMaskingRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2191,20 +1862,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. + * {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. */ - 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; + 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; /** - * Deletes a database. + * 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 @@ -2212,7 +1883,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2221,14 +1892,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a database. + * 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 @@ -2236,7 +1907,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2250,7 +1921,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DataMaskingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2258,19 +1929,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. + * {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. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FirewallRules { /** - * Gets a database. + * 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 @@ -2278,27 +1960,34 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} firewallRuleName The name of the firewall rule. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The required parameters for creating or updating + * a firewall rule. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @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. + * @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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database. + * 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 @@ -2306,13 +1995,20 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} firewallRuleName The name of the firewall rule. * - * @param {object} [options] Optional Parameters. + * @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} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @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 @@ -2324,7 +2020,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2332,20 +2028,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 a list of databases in a server. + * 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 @@ -2353,28 +2049,23 @@ export interface Databases { * * @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} firewallRuleName The name of the firewall rule. * - * @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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in a server. + * 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 @@ -2382,14 +2073,9 @@ export interface Databases { * * @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} firewallRuleName The name of the firewall rule. * - * @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 +2087,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. * @@ -2409,20 +2095,19 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * Gets a database inside of an elastic pool. + * 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 @@ -2430,10 +2115,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} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2442,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. */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database inside of an elastic pool. + * 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 @@ -2457,10 +2139,70 @@ 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} firewallRuleName The name of the firewall 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 {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. + * + * {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. + */ + 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; + + + /** + * 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. + * + * @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 a list of firewall rules. * - * @param {string} databaseName The name of the database to be 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} [options] Optional Parameters. * @@ -2474,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. * @@ -2482,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. */ - 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; + 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 an elastic pool. + * 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 @@ -2503,8 +2255,13 @@ 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} 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. * @@ -2513,14 +2270,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in an elastic pool. + * 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 @@ -2528,8 +2285,13 @@ 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} 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. * @@ -2543,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. * @@ -2551,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. - */ - 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, 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 a recommented 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 @@ -2572,10 +2334,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2584,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. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: 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 a recommented 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 @@ -2599,10 +2358,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. - * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2616,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. * @@ -2624,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. */ - 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; + 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 inside a recommented 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 @@ -2645,8 +2401,7 @@ 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. * * @param {object} [options] Optional Parameters. * @@ -2655,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. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: 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 inside a recommented 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 @@ -2670,8 +2425,7 @@ 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. * * @param {object} [options] Optional Parameters. * @@ -2685,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. * @@ -2693,16 +2447,26 @@ 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. */ - 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; + 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 { /** @@ -3216,7 +2980,7 @@ export interface Databases { /** - * Renames a 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 @@ -3224,12 +2988,7 @@ export interface Databases { * * @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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -3242,10 +3001,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Renames a 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 @@ -3253,12 +3012,7 @@ export interface Databases { * * @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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -3286,13 +3040,13 @@ export interface Databases { * * {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; + 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; /** - * Pauses a data warehouse. + * 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 @@ -3300,8 +3054,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 @@ -3309,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. */ - beginPauseWithHttpOperationResponse(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. + * 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 @@ -3324,8 +3076,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 @@ -3338,7 +3088,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3346,19 +3096,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. + * {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. */ - 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; + 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; /** - * 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 @@ -3366,7 +3117,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. * @@ -3375,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. */ - beginResumeWithHttpOperationResponse(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>; /** - * 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 @@ -3390,7 +3141,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. * @@ -3404,7 +3155,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. * @@ -3412,15 +3163,16 @@ 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. */ - 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, 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; /** @@ -3432,14 +3184,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 +3211,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,103 +3234,66 @@ 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 {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. @@ -3584,7 +3309,7 @@ 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>; + 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. @@ -3595,14 +3320,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.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.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @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 +3347,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,103 +3370,66 @@ export interface Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.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.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. @@ -3763,9 +3461,75 @@ 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; + 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; + + + /** + * 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 + * 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * 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 {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; /** @@ -3777,14 +3541,24 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} parameters The 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. @@ -3794,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 @@ -3817,103 +3591,68 @@ export interface Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3925,7 +3664,7 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates an existing database. @@ -3936,14 +3675,24 @@ 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 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 {object} parameters The required parameters for updating a database. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {object} [parameters.tags] Resource tags. + * @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. @@ -3953,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 @@ -3976,103 +3725,68 @@ export interface Databases { * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions -l westus --query [].name`. Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name` . - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." or use the Azure - * CLI command `az sql db list-editions --location --query - * [].supportedServiceLevelObjectives[].name`. Possible values include: - * 'System', 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', - * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', - * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', - * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', - * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', - * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', - * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', - * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', - * 'ElasticPool' + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} [parameters.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.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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4100,13 +3814,13 @@ export interface Databases { * * {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; + 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; /** - * Imports a bacpac into a new database. + * 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 @@ -4114,63 +3828,66 @@ 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} elasticPoolName The name of the elastic pool. * - * @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 {object} [options] Optional Parameters. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @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. + */ + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of databases in an elastic pool. * - * @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} 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 + * @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. + * {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. */ - beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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; + /** - * Imports a bacpac into a new 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 @@ -4178,47 +3895,31 @@ 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} databaseName The name of the database to be paused. * - * @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 {object} [options] Optional Parameters. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @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. + */ + pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Pauses a database. * - * @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 to be paused. * * @param {object} [options] Optional Parameters. * @@ -4232,7 +3933,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4240,21 +3941,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. + * {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. */ - 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; + 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; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -4262,48 +3962,66 @@ 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} databaseName The name of the database to be resumed. * - * @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. + */ + resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resumes a database. * - * @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 to be resumed. * * @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. + * {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. */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, 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; + /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -4311,31 +4029,41 @@ 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 to rename. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {string} [parameters.name] The name of the extension. + * @param {string} parameters.id The target ID for the resource * - * @param {string} [parameters.type] The type of the extension. + * @param {object} [options] Optional Parameters. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." + * @returns {Promise} A promise is returned * - * @param {string} parameters.storageUri The storage uri to use. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @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 {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. * @@ -4349,7 +4077,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. * @@ -4357,20 +4085,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. */ - 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; + 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; /** - * Exports a database to a bacpac. + * 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 @@ -4378,9 +4105,30 @@ 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 importing a Bacpac + * into a database. * - * @param {object} parameters The required parameters for exporting 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' @@ -4410,10 +4158,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * 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 @@ -4421,9 +4169,30 @@ 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 importing a Bacpac + * into a database. * - * @param {object} parameters The required parameters for exporting 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' @@ -4469,92 +4238,14 @@ export interface Databases { * * {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; + 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 or updates a database's threat detection policy. + * 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 @@ -4562,44 +4253,31 @@ 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 database Threat Detection policy. + * @param {string} databaseName The name of the database to import into * - * @param {string} [parameters.location] The geo-location where the resource - * lives + * @param {object} parameters The required parameters for importing a Bacpac + * into a 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.name] The name of the extension. * - * @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.type] The type of the extension. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. 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.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.storageUri The storage uri to use. * - * @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.administratorLogin The name of the SQL + * administrator. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -4608,14 +4286,15 @@ 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's threat detection policy. + * 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 @@ -4623,44 +4302,31 @@ 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 database Threat Detection policy. + * @param {string} databaseName The name of the database to import into * - * @param {string} [parameters.location] The geo-location where the resource - * lives + * @param {object} parameters The required parameters for importing a Bacpac + * into a 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.name] The name of the extension. * - * @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.type] The type of the extension. * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. 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.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.storageUri The storage uri to use. * - * @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.administratorLogin The name of the SQL + * administrator. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -4674,7 +4340,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4682,30 +4348,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. + * {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. */ - 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 { + 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; /** - * Creates or updates a database data masking policy + * 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 @@ -4713,18 +4369,26 @@ export interface DataMaskingPolicies { * * @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 exported. * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @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.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. * @@ -4733,14 +4397,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>; + beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking policy + * 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 @@ -4748,18 +4412,26 @@ export interface DataMaskingPolicies { * * @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 exported. * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @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.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. * @@ -4773,7 +4445,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4781,20 +4453,20 @@ 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. + * {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. */ - 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; + 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; /** - * Gets a database data masking 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 @@ -4802,7 +4474,7 @@ export interface DataMaskingPolicies { * * @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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -4811,14 +4483,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>; + beginUpgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database data masking 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 @@ -4826,7 +4498,7 @@ export interface DataMaskingPolicies { * * @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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -4840,7 +4512,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. * @@ -4848,29 +4520,19 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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 { + 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 or updates a database data masking 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 @@ -4880,53 +4542,117 @@ 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 requested database resource state. * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @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.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. + * @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.columnName The column name on which the data - * masking rule is applied. + * @param {number} [parameters.sku.capacity] Capacity 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.createMode] Specifies the mode of database + * creation. * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. + * Default: regular database creation. * - * @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. + * 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.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. + * 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 {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. + * 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.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. + * 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. * @@ -4935,70 +4661,134 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking 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} 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} resourceGroupName The name 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 {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -5012,7 +4802,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 +4810,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; + 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; /** - * Gets a list of database data masking rules. + * 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 @@ -5050,14 +4840,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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database data masking rules. + * 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 @@ -5079,7 +4869,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. * @@ -5087,30 +4877,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 - * ElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPools { + 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; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5118,34 +4897,117 @@ 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. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.sku] The name and tier of the 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 {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.location Resource location. + * 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. * @@ -5154,14 +5016,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>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5169,34 +5031,117 @@ 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. * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {object} [parameters.sku] The name and tier of the 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 {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} parameters.location Resource location. + * 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. * @@ -5210,7 +5155,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5218,20 +5163,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {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, 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; + 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; /** - * Updates an existing 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 @@ -5239,31 +5184,7 @@ 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 {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} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5272,14 +5193,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>; + beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing 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 @@ -5287,31 +5208,7 @@ 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 {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} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5325,7 +5222,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5333,20 +5230,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {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, 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; + 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; /** - * Deletes the 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 @@ -5354,7 +5251,7 @@ 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 the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5363,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the 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 @@ -5378,7 +5275,7 @@ 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 the database to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5392,7 +5289,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5400,28 +5297,23 @@ 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. + * {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. */ - 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; + 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 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 databases. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5430,23 +5322,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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets 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 - * 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} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5460,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. * @@ -5468,26 +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. */ - 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; + 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 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. + * Gets a list of databases in an 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. * @@ -5496,20 +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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of databases in an 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. * @@ -5523,7 +5403,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5531,16 +5411,25 @@ 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. + * {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?: { 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 + * ElasticPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPools { /** @@ -5685,7 +5574,7 @@ export interface ElasticPools { /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5693,50 +5582,24 @@ 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 {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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { skip? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * 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 @@ -5744,37 +5607,11 @@ 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 {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 * @@ -5785,7 +5622,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5793,20 +5630,20 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {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. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { skip? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { skip? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. + * 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 @@ -5814,31 +5651,7 @@ 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 {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. * @@ -5851,10 +5664,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>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * 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 @@ -5862,31 +5675,7 @@ 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 {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. * @@ -5915,22 +5704,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 { + 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; /** - * 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 +5718,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 +5767,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>; + createOrUpdateWithHttpOperationResponse(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 +5782,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 +5836,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 +5844,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. + * 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 +5865,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 +5878,10 @@ export interface FirewallRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(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>; /** - * 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 +5889,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 +5917,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; + 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; /** - * 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 +5931,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,22 +5978,60 @@ 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>; + updateWithHttpOperationResponse(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 * 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 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} firewallRuleName The name of the firewall rule. + * @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 +6045,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,20 +6053,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. */ - 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; + 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; /** - * Returns a list of firewall rules. + * 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 @@ -6160,6 +6074,48 @@ export interface FirewallRules { * * @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 @@ -6167,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. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of firewall rules. + * 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 @@ -6182,6 +6138,48 @@ export interface FirewallRules { * * @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 @@ -6194,7 +6192,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. * @@ -6202,30 +6200,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 { + 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; /** - * Updates a database geo backup policy. + * 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 @@ -6233,13 +6221,7 @@ 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} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -6248,14 +6230,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>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database geo backup policy. + * 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 @@ -6263,13 +6245,7 @@ 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} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -6283,7 +6259,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6291,20 +6267,19 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 geo backup policy. + * 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 @@ -6312,7 +6287,45 @@ 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} 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. * @@ -6321,14 +6334,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>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a geo backup policy. + * 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 @@ -6336,7 +6349,45 @@ 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} 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. * @@ -6350,7 +6401,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6358,28 +6409,23 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {ElasticPool} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPool} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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, 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 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 - * Manager API or the portal. + * Gets all elastic pools in a server. * - * @param {string} serverName The name of the server. - * - * @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. * @@ -6388,22 +6434,17 @@ 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>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets all elastic pools in a server. * - * @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. * @@ -6417,7 +6458,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicyListResult} - The deserialized result object. + * @resolve {ElasticPoolListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6425,17 +6466,16 @@ 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. + * {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. */ - 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; } /** @@ -17937,3 +17977,79 @@ export interface ElasticPoolOperations { listByElasticPoolNext(nextPageLink: string, callback: ServiceCallback): void; listByElasticPoolNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * Capabilities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Capabilities { + + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param {string} locationName The location name whose capabilities are + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the subscription capabilities available for the specified location. + * + * @param {string} locationName The location name whose capabilities are + * retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LocationCapabilities} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. + * See {@link LocationCapabilities} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { include? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 75f2edb211..56d738959a 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -16,16 +16,15 @@ 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'); @@ -56,3 +55,4 @@ exports.ServerDnsAliases = require('./serverDnsAliases'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); +exports.Capabilities = require('./capabilities'); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 33a18a4c65..951e647e01 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -56,16 +56,15 @@ 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; @@ -96,6 +95,7 @@ export default class SqlManagementClient extends AzureServiceClient { restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; + capabilities: operations.Capabilities; } export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index fa33d9f04e..4c2f9a8ebd 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -73,16 +73,15 @@ 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); @@ -113,6 +112,7 @@ class SqlManagementClient extends ServiceClient { this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); this.elasticPoolOperations = new operations.ElasticPoolOperations(this); + this.capabilities = new operations.Capabilities(this); this.models = models; msRest.addSerializationMixin(this); } From 3d31599b1901c9e9abfce490c5d03b31687c509c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 24 Mar 2018 23:28:32 +0000 Subject: [PATCH 3/4] Generated from 5b2ebc1c2bacf73e322054a61806ff12f2fe4eee Fixed CapabilitiesList example param name --- .../sqlManagement2/lib/operations/databases.js | 14 +++++++------- .../sqlManagement2/lib/operations/index.d.ts | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index 7febf21ad9..efc662ac6d 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -1818,7 +1818,7 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _move(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3949,7 +3949,7 @@ class Databases { this._listByElasticPool = _listByElasticPool; this._pause = _pause; this._resume = _resume; - this._rename = _rename; + this._move = _move; this._beginImportMethod = _beginImportMethod; this._beginCreateImportOperation = _beginCreateImportOperation; this._beginExportMethod = _beginExportMethod; @@ -5919,11 +5919,11 @@ class Databases { * * @reject {Error} - The error object. */ - renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + moveWithHttpOperationResponse(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) => { + self._move(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5975,7 +5975,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + move(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5984,14 +5984,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._move(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); + return self._move(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index c753734bba..200f70bf36 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -4047,7 +4047,7 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + moveWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Renames a database. @@ -4091,9 +4091,9 @@ export interface Databases { * * {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; + move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; + move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** From 99a40b9afa9ed0986e3502578dadb47a451237a6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 24 Mar 2018 23:36:00 +0000 Subject: [PATCH 4/4] Generated from 5b2ebc1c2bacf73e322054a61806ff12f2fe4eee Fixed CapabilitiesList example param name --- .../sqlManagement2/lib/operations/databases.js | 14 +++++++------- .../sqlManagement2/lib/operations/index.d.ts | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index efc662ac6d..7febf21ad9 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -1818,7 +1818,7 @@ function _resume(resourceGroupName, serverName, databaseName, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _move(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3949,7 +3949,7 @@ class Databases { this._listByElasticPool = _listByElasticPool; this._pause = _pause; this._resume = _resume; - this._move = _move; + this._rename = _rename; this._beginImportMethod = _beginImportMethod; this._beginCreateImportOperation = _beginCreateImportOperation; this._beginExportMethod = _beginExportMethod; @@ -5919,11 +5919,11 @@ class Databases { * * @reject {Error} - The error object. */ - moveWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + renameWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._move(resourceGroupName, serverName, databaseName, parameters, 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); } @@ -5975,7 +5975,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - move(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5984,14 +5984,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._move(resourceGroupName, serverName, databaseName, parameters, 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._move(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index 200f70bf36..c753734bba 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -4047,7 +4047,7 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - moveWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Renames a database. @@ -4091,9 +4091,9 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; - move(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, 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; /**